/* =================================================================
   Salama Hosting — Auth CSS
   Loaded by: layouts/guest.blade.php
   ================================================================= */

/* ── Custom Properties ──────────────────────────────────────────── */
:root {
    /* Customer teal palette */
    --teal-50:  #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-900: #134e4a;

    /* Admin navy palette */
    --navy-50:  #f0f4ff;
    --navy-600: #2a5298;
    --navy-700: #1e3c72;

    /* Portal dark palette */
    --portal-bg-from: #0f172a;
    --portal-bg-to:   #1e293b;

    /* Neutral */
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;

    --danger:  #ef4444;
    --success: #22c55e;

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;

    --shadow-light: 0 25px 65px rgba(0,0,0,0.10), 0 4px 20px rgba(0,0,0,0.05);
    --shadow-dark:  0 30px 70px rgba(0,0,0,0.42), 0 6px 20px rgba(0,0,0,0.22);
    --shadow-btn-teal: 0 8px 28px rgba(13,148,136,0.36);
    --shadow-btn-navy: 0 8px 28px rgba(30,60,114,0.40);

    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* ── Body Theme Classes ─────────────────────────────────────────── */
body.auth-customer { background: linear-gradient(135deg, var(--teal-50) 0%, var(--teal-100) 100%); }
body.auth-admin    { background: linear-gradient(160deg, #1a2545 0%, #1e2d5a 100%); }
body.auth-portal   { background: linear-gradient(160deg, var(--portal-bg-from) 0%, var(--portal-bg-to) 100%); }

/* ── Card Entry Animation ───────────────────────────────────────── */
.ac, .adm-card, .fp-card, .rp-card, .tfa-card, .portal-wrap {
    animation: auth-appear 0.38s var(--ease) both;
}
@keyframes auth-appear {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Split Card (Customer pages) ────────────────────────────────── */
.ac {
    display: flex;
    width: 100%;
    max-width: 940px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

/* Left brand panel */
.al {
    width: 43%;
    background: linear-gradient(160deg, var(--teal-900) 0%, var(--teal-600) 52%, var(--teal-500) 100%);
    color: #fff;
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Right form panel */
.ar {
    flex: 1;
    background: #fff;
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Decorative circles on brand panel */
.dc { position: absolute; border-radius: 50%; pointer-events: none; }
.dc1 { width: 255px; height: 255px; background: rgba(255,255,255,0.07); top: -85px; right: -85px; }
.dc2 { width: 185px; height: 185px; background: rgba(255,255,255,0.05); bottom: -62px; left: -62px; }
.dc3 { width: 115px; height: 115px; background: rgba(255,255,255,0.04); top: 48%; right: -28px; }

/* Brand panel typography */
.bn {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}
.bn i { font-size: 1.35rem; }

.bh {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.65rem;
    position: relative;
}

.bs {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.65;
    margin-bottom: 2rem;
    position: relative;
}

.bf { list-style: none; padding: 0; margin: 0; position: relative; }
.bf li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.88);
    padding: 0.3rem 0;
}
.bf li i { color: #6ee7b7; font-size: 0.8rem; flex-shrink: 0; }

/* ── Admin Card (centered compact) ──────────────────────────────── */
.adm-card {
    width: 100%;
    max-width: 430px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-dark);
}
.adm-card.wide { max-width: 510px; }

.adm-head {
    background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-600) 100%);
    color: #fff;
    padding: 2.25rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.adm-head-dc1 {
    position: absolute; border-radius: 50%;
    width: 195px; height: 195px;
    background: rgba(255,255,255,0.06); top: -68px; right: -68px;
}
.adm-head-dc2 {
    position: absolute; border-radius: 50%;
    width: 130px; height: 130px;
    background: rgba(255,255,255,0.04); bottom: -45px; left: -45px;
}
.adm-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin: 0 auto 0.9rem;
    position: relative;
}
.adm-badge {
    display: inline-block;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.92);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.22rem 0.75rem;
    border-radius: 2rem;
    margin-bottom: 0.65rem;
    display: block;
}
.adm-head h1  { font-size: 1.3rem; font-weight: 700; margin: 0 0 0.3rem; position: relative; }
.adm-head p   { font-size: 0.8rem; color: rgba(255,255,255,0.68); margin: 0; position: relative; }
.adm-body     { background: #fff; padding: 2rem; }

.adm-links { margin-top: 1.35rem; display: flex; flex-direction: column; gap: 0.65rem; }
.adm-link-row { text-align: center; font-size: 0.875rem; }
.adm-link-row a { color: var(--navy-600); font-weight: 500; text-decoration: none; }
.adm-link-row a:hover { text-decoration: underline; }

.adm-reg-box, .adm-log-box {
    background: var(--navy-50);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
}
.adm-reg-box a, .adm-log-box a { color: var(--navy-600); font-weight: 600; text-decoration: none; }
.adm-reg-box a:hover, .adm-log-box a:hover { text-decoration: underline; }

/* ── Form Panel Typography ──────────────────────────────────────── */
.ft   { font-size: 1.55rem; font-weight: 700; color: var(--gray-900); margin: 0 0 0.2rem; line-height: 1.2; }
.fsub { font-size: 0.875rem; color: var(--gray-500); margin: 0 0 1.75rem; }
.fsub a { color: var(--teal-600); font-weight: 500; text-decoration: none; }
.fsub a:hover { text-decoration: underline; }

/* ── Form Fields ────────────────────────────────────────────────── */
.fg     { margin-bottom: 1.15rem; }
.fgrid  { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.fl {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.fi {
    width: 100%;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.72rem 1rem;
    font-size: 0.9rem;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: border-color 0.17s var(--ease), box-shadow 0.17s var(--ease), background 0.17s var(--ease);
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.5;
}
.fi::placeholder { color: var(--gray-400); }
.fi:hover:not(:focus):not(:disabled) { border-color: #c4cad4; background: #fff; }
.fi:focus { background: #fff; }
.fi.is-invalid { border-color: var(--danger); background: #fff8f8; }
.fi.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }

/* Customer input focus (teal) */
body.auth-customer .fi:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }

/* Admin / generic input focus (navy) */
body.auth-admin .fi:focus,
.adm-body .fi:focus,
body:not(.auth-customer) .fi:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(42,82,152,0.12); }

/* Password field with eye toggle */
.fw { display: flex; }
.fw .fi { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; flex: 1; }
.feye {
    border: 1.5px solid var(--gray-200);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--gray-50);
    padding: 0 0.9rem;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.feye:hover { color: var(--gray-700); background: var(--gray-100); }

/* Field error */
.ferr {
    font-size: 0.78rem;
    color: #dc2626;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.4;
}

/* Checkbox row */
.fck {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    line-height: 1.5;
}
.fck input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.18rem;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 0.25rem;
}
body.auth-customer .fck input[type="checkbox"] { accent-color: var(--teal-600); }
body.auth-admin    .fck input[type="checkbox"] { accent-color: var(--navy-600); }
.fck a { color: var(--teal-600); font-weight: 500; text-decoration: none; }

/* Hints below fields */
.fhint { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.35rem; line-height: 1.4; }
.fhint i { color: var(--navy-600); }
.pwd-hint { font-size: 0.78rem; color: var(--gray-500); margin-top: 0.35rem; }
body.auth-customer .pwd-hint i { color: var(--teal-600); }

/* Info banner (admin register) */
.info-box {
    background: var(--navy-50);
    border-left: 3px solid var(--navy-600);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.35rem;
    font-size: 0.82rem;
    color: var(--gray-700);
    line-height: 1.55;
}
.info-box i { color: var(--navy-600); }

/* OTP / large code input */
.fi-otp {
    width: 100%;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    font-size: 2rem;
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: 700;
    transition: border-color 0.17s var(--ease), box-shadow 0.17s var(--ease);
    font-family: 'Courier New', monospace;
    box-sizing: border-box;
}
.fi-otp::placeholder { color: var(--gray-300); letter-spacing: 0.4em; }
.fi-otp:hover:not(:focus) { border-color: #c4cad4; }
.fi-otp:focus { border-color: var(--navy-600); background: #fff; box-shadow: 0 0 0 3px rgba(42,82,152,0.12); }
.fi-otp.is-invalid { border-color: var(--danger); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-teal,
.btn-navy,
.btn-main {
    width: 100%;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.82rem 1.5rem;
    font-size: 0.93rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
    position: relative;
    overflow: hidden;
    color: #fff;
}

.btn-teal { background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%); }
.btn-navy,
.btn-main { background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-600) 100%); }

.btn-teal:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn-teal); }
.btn-navy:hover,
.btn-main:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn-navy); }

.btn-teal:active,
.btn-navy:active,
.btn-main:active { transform: translateY(0); box-shadow: none; }

.btn-teal::after,
.btn-navy::after,
.btn-main::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.18s;
}
.btn-teal:hover::after,
.btn-navy:hover::after,
.btn-main:hover::after { background: rgba(255,255,255,0.06); }

/* ── Alerts ─────────────────────────────────────────────────────── */
.alrt {
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    margin-bottom: 1.15rem;
    font-size: 0.855rem;
    line-height: 1.55;
}
.alrt.danger  { background: #fef2f2; border-left: 3px solid var(--danger);  color: #991b1b; }
.alrt.success { background: #f0fdf4; border-left: 3px solid var(--success); color: #166534; }
.alrt strong  { font-weight: 600; }
.alrt > div   { margin-top: 0.2rem; }

/* ── Form Footer Elements ───────────────────────────────────────── */
.aor {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    font-size: 0.78rem;
}
.aor::before, .aor::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.aor span { color: var(--gray-400); }

.alk { text-align: center; font-size: 0.875rem; }
.alk a { color: var(--teal-600); font-weight: 500; text-decoration: none; }
.alk a:hover { text-decoration: underline; }

.areg, .alog {
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.75rem;
}
body.auth-customer .areg, body.auth-customer .alog { background: var(--teal-50); }
body:not(.auth-customer) .areg, body:not(.auth-customer) .alog { background: var(--navy-50); }
.areg a, .alog a { font-weight: 600; text-decoration: none; }
body.auth-customer .areg a, body.auth-customer .alog a { color: var(--teal-600); }
body:not(.auth-customer) .areg a, body:not(.auth-customer) .alog a { color: var(--navy-600); }
.areg a:hover, .alog a:hover { text-decoration: underline; }

/* ── Portal Selection ───────────────────────────────────────────── */
.portal-wrap { max-width: 680px; width: 100%; }

.portal-header { text-align: center; margin-bottom: 2.5rem; }
.portal-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
}
.portal-logo i { font-size: 1.4rem; color: var(--teal-500); }
.portal-header p { font-size: 0.95rem; color: rgba(255,255,255,0.5); margin: 0; }

.portal-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

.portal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 1.1rem;
    padding: 2.25rem 1.75rem;
    color: #fff;
    text-decoration: none;
    transition:
        background 0.24s var(--ease),
        transform 0.24s var(--ease),
        border-color 0.24s var(--ease),
        box-shadow 0.24s var(--ease);
}
.portal-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.22);
    color: #fff;
    box-shadow: 0 18px 44px rgba(0,0,0,0.3);
}
.portal-card:active { transform: translateY(-1px); }

.p-icon {
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.15rem;
}
.p-icon.teal { background: linear-gradient(135deg, var(--teal-600), var(--teal-500)); }
.p-icon.navy { background: linear-gradient(135deg, var(--navy-700), var(--navy-600)); }

.portal-card h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.45rem; }
.portal-card p  { font-size: 0.85rem; color: rgba(255,255,255,0.58); margin: 0 0 1.5rem; line-height: 1.5; }

.p-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 1.1rem;
    border-radius: 2rem;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.82);
    background: rgba(255,255,255,0.08);
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    margin-top: auto;
}
.portal-card:hover .p-btn {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}

.portal-foot { text-align: center; margin-top: 2rem; font-size: 0.875rem; color: rgba(255,255,255,0.42); }
.portal-foot a { color: var(--teal-500); font-weight: 500; text-decoration: none; }
.portal-foot a:hover { text-decoration: underline; }

/* ── Compact Cards (forgot / reset / 2FA) ───────────────────────── */
.fp-card, .rp-card, .tfa-card {
    max-width: 450px;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}
body.auth-admin .fp-card,
body.auth-admin .rp-card,
body.auth-admin .tfa-card { box-shadow: var(--shadow-dark); }

/* Card headers — navy default, teal for customer pages */
.fp-head, .rp-head, .tfa-head {
    background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-600) 100%);
    color: #fff;
    padding: 2.25rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
body.auth-customer .fp-head,
body.auth-customer .rp-head {
    background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-600) 100%);
}

/* Decorative circles inside card headers */
.fp-head-dc1, .rp-head-dc1, .tfa-head-dc1 {
    position: absolute; border-radius: 50%;
    width: 175px; height: 175px;
    background: rgba(255,255,255,0.07); top: -58px; right: -58px;
}
.fp-head-dc2, .rp-head-dc2, .tfa-head-dc2 {
    position: absolute; border-radius: 50%;
    width: 118px; height: 118px;
    background: rgba(255,255,255,0.05); bottom: -40px; left: -40px;
}

/* Icon circle */
.fp-icon, .rp-icon, .tfa-icon {
    width: 3.25rem;
    height: 3.25rem;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 auto 0.85rem;
    position: relative;
}
.tfa-icon { width: 3.5rem; height: 3.5rem; font-size: 1.4rem; }

/* Badge pill */
.fp-badge, .rp-badge, .tfa-badge {
    display: inline-block;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.92);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.22rem 0.75rem;
    border-radius: 2rem;
    margin-bottom: 0.65rem;
}

.fp-head h1, .rp-head h1, .tfa-head h1 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    position: relative;
}
.fp-head p, .rp-head p, .tfa-head p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
    position: relative;
}

.fp-body, .rp-body, .tfa-body { background: #fff; padding: 2rem; }

.fp-desc {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.fp-back, .rp-back {
    text-align: center;
    margin-top: 1.35rem;
    font-size: 0.875rem;
}
.fp-back a, .rp-back a {
    color: var(--gray-500);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.fp-back a:hover, .rp-back a:hover { color: var(--gray-900); text-decoration: underline; }

/* 2FA specifics */
.tfa-desc {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    text-align: center;
}
.tfa-expire {
    text-align: center;
    margin-top: 1.15rem;
    font-size: 0.82rem;
    color: var(--gray-400);
}
/* Center 2FA error */
.tfa-body .ferr { justify-content: center; }

/* ── Accessibility ──────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 2px;
    border-radius: 2px;
}
body.auth-customer :focus-visible { outline-color: var(--teal-600); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .ac { flex-direction: column; max-width: 480px; }
    .al { width: 100%; padding: 2rem 1.75rem; }
    .bf, .bs { display: none; }
    .ar { padding: 2rem 1.75rem; }
    .fgrid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
    .portal-cards { grid-template-columns: 1fr; }
    .portal-wrap  { max-width: 380px; }
    .auth-container { padding: 1rem; }
    .adm-body, .fp-body, .rp-body, .tfa-body, .ar { padding: 1.5rem; }
    .fp-card, .rp-card, .tfa-card { border-radius: 1rem; }
}

@media (max-width: 400px) {
    .adm-card { border-radius: 1rem; }
    .ac { border-radius: 1rem; }
}
