/* auth_ui.css — Vision Logistics · Login & Register */
@import url('password_toggle.css');

:root {
    --v-primary: #0b3d91;
    --v-primary-dark: #082a66;
    --v-accent: #0f766e;
    --v-accent-light: #14b8a6;
    --v-bg: #eef2f7;
    --v-surface: #ffffff;
    --v-border: #dbe3ef;
    --v-text: #0f172a;
    --v-muted: #64748b;
    --v-radius: 14px;
    --v-shadow: 0 18px 48px rgba(15, 23, 42, 0.1);
    --v-font: 'Segoe UI', system-ui, -apple-system, Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

.auth-page {
    font-family: var(--v-font);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--v-bg);
    color: var(--v-text);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (min-width: 960px) {
    .auth-shell {
        grid-template-columns: minmax(300px, 42%) 1fr;
    }
}

.auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 48px 40px;
    color: #fff;
    background: linear-gradient(145deg, var(--v-primary) 0%, #0c4a6e 45%, var(--v-accent) 100%);
}

@media (min-width: 960px) {
    .auth-brand { display: flex; flex-direction: column; justify-content: center; }
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,.12) 0%, transparent 45%),
        radial-gradient(circle at 80% 20%, rgba(20,184,166,.25) 0%, transparent 40%);
    pointer-events: none;
}

.auth-brand-inner { position: relative; z-index: 1; max-width: 400px; }

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 28px;
}

.auth-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.auth-brand h2 {
    margin: 0 0 14px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.25;
    font-weight: 800;
}

.auth-brand p {
    margin: 0;
    font-size: 15px;
    line-height: 1.75;
    color: rgba(255,255,255,.88);
}

.auth-brand-features {
    margin-top: 32px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.auth-brand-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,.92);
}

.auth-brand-features li span {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: grid;
    place-items: center;
    font-size: 11px;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(28px, env(safe-area-inset-bottom, 0px));
}

.auth-page.auth-register .auth-main {
    align-items: flex-start;
    padding-top: 28px;
}

.auth-wrap {
    width: 100%;
    max-width: 460px;
}

.auth-mobile-brand {
    text-align: center;
    margin-bottom: 20px;
}

@media (min-width: 960px) {
    .auth-mobile-brand { display: none; }
}

.auth-mobile-brand .auth-logo {
    justify-content: center;
    color: var(--v-primary);
    margin-bottom: 0;
    font-size: 1.25rem;
}

.auth-mobile-brand .auth-logo-mark {
    background: var(--v-primary);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
}

.auth-card {
    background: var(--v-surface);
    border: 1px solid var(--v-border);
    border-radius: var(--v-radius);
    box-shadow: var(--v-shadow);
    padding: 28px 24px 24px;
}

@media (max-width: 480px) {
    .auth-card { padding: 22px 16px 20px; }
    .auth-card h1, .auth-card h2 { font-size: 1.2rem; }
    .auth-btn { height: 50px; font-size: 17px; }
    .auth-brand-features { margin-top: 24px; }
    .auth-phone-wrap .iti--separate-dial-code .iti__selected-country {
        max-width: 38%;
    }
    .auth-phone-wrap .iti--separate-dial-code .iti__selected-dial-code {
        font-size: 13px;
    }
}

@media (max-width: 959px) {
    .auth-wrap { max-width: 100%; }
    .auth-card { margin: 0 auto; }
}

@media (min-width: 480px) {
    .auth-card { padding: 32px 30px 28px; }
}

.auth-card-head { margin-bottom: 22px; text-align: center; }

.auth-card h1, .auth-card h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--v-text);
}

.auth-sub {
    margin: 0;
    color: var(--v-muted);
    font-size: 14px;
    line-height: 1.65;
}

.auth-field { margin-bottom: 16px; }

.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.auth-input,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--v-border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: var(--v-text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input:focus,
.auth-card input:focus {
    outline: none;
    border-color: var(--v-accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.auth-pw-wrap { position: relative; }

.auth-pw-wrap input {
    padding-inline-end: 46px;
}

.auth-pw-toggle {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    border-radius: 8px;
}

.auth-pw-toggle:hover {
    background: #f1f5f9;
    color: var(--v-text);
}

.auth-pw-rules {
    list-style: none;
    margin: 10px 0 0;
    padding: 12px 14px;
    font-size: 12px;
    color: var(--v-muted);
    line-height: 1.75;
    background: #f8fafc;
    border: 1px solid #e8edf4;
    border-radius: 10px;
    display: grid;
    gap: 2px;
}

.auth-pw-rules li {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color .15s;
}

.auth-pw-rules li::before {
    content: '○';
    font-size: 10px;
    color: #94a3b8;
    width: 14px;
    flex-shrink: 0;
    text-align: center;
}

.auth-pw-rules li.ok { color: #059669; font-weight: 600; }
.auth-pw-rules li.ok::before { content: '✓'; color: #059669; font-weight: bold; }

.auth-pw-match {
    font-size: 12px;
    margin-top: 8px;
    color: #94a3b8;
}

.auth-pw-match.ok { color: #059669; font-weight: 600; }
.auth-pw-match.err { color: #dc2626; font-weight: 600; }

/* intl-tel-input — منع التداخل */
.auth-phone-wrap { position: relative; z-index: 2; }
.auth-phone-wrap .iti { width: 100%; display: block; }

.auth-phone-wrap .iti__tel-input,
.auth-phone-wrap .iti input[type="tel"] {
    width: 100% !important;
    height: 46px !important;
    padding-block: 0 !important;
    padding-inline-start: 52px !important;
    padding-inline-end: 12px !important;
    border: 1px solid var(--v-border) !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-family: inherit !important;
    background: #fff !important;
}

.auth-phone-wrap .iti__tel-input:focus {
    border-color: var(--v-accent) !important;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15) !important;
}

.auth-phone-wrap .iti--separate-dial-code .iti__tel-input,
.auth-phone-wrap .iti--separate-dial-code input[type="tel"] {
    padding-inline-start: 12px !important;
}

.auth-phone-wrap .iti--separate-dial-code .iti__country-container,
.auth-phone-wrap .iti--separate-dial-code .iti__selected-country {
    min-height: 46px;
}

.auth-phone-wrap .iti--separate-dial-code .iti__selected-country {
    border-radius: 10px 0 0 10px;
    padding-inline: 8px 6px;
    gap: 6px;
}

.auth-phone-wrap .iti--separate-dial-code .iti__selected-country .iti__flag {
    flex-shrink: 0;
    display: inline-block;
}

.auth-phone-wrap .iti--separate-dial-code .iti__selected-dial-code {
    direction: ltr;
    unicode-bidi: isolate;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

[dir="rtl"] .auth-phone-wrap .iti--separate-dial-code .iti__selected-country {
    border-radius: 0 10px 10px 0;
}

.auth-phone-wrap .iti__dropdown-content {
    border-radius: 10px;
    box-shadow: var(--v-shadow);
    z-index: 10050;
    max-height: min(280px, 50vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-phone-hint {
    font-size: 12px;
    margin-top: 6px;
    color: var(--v-muted);
    min-height: 18px;
}

.auth-phone-hint.ok { color: #059669; font-weight: 600; }
.auth-phone-hint.err { color: #dc2626; font-weight: 600; }

/* جوال — منع تكبير iOS وتداخل قائمة الدول */
@media (max-width: 959px) {
    .auth-page.auth-register .auth-main {
        align-items: flex-start;
        padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
    }
    .auth-phone-wrap { z-index: 5; }
    .auth-phone-wrap .iti__dropdown-content {
        z-index: 10060;
        max-height: min(240px, 45vh);
    }
}

.iti--fullscreen-popup.iti--container,
.iti--fullscreen-popup .iti__dropdown-content {
    z-index: 10070;
}

.auth-btn {
    margin-top: 8px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--v-primary), #0e5bb5);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, opacity .15s;
    box-shadow: 0 8px 20px rgba(11, 61, 145, 0.25);
}

.auth-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(11, 61, 145, 0.32);
}

.auth-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-msg-ok, .auth-msg-err {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.65;
}

.auth-msg-ok { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.auth-msg-err { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

.auth-note {
    font-size: 12px;
    color: var(--v-muted);
    background: #f8fafc;
    border: 1px solid #e8edf4;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 18px;
    line-height: 1.7;
}

.auth-links {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    justify-content: center;
}

.auth-links a {
    color: var(--v-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

.auth-forgot {
    margin: -4px 0 14px;
    text-align: end;
    font-size: 13px;
}

.auth-forgot a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.auth-forgot a:hover { text-decoration: underline; }

.auth-lang {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
}

.auth-lang a { color: var(--v-muted); text-decoration: none; }
.auth-lang a:hover { color: var(--v-primary); }

.auth-session-hint {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #1e40af;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.65;
    text-align: center;
}

.auth-session-hint a { color: #1d4ed8; font-weight: 700; }

.auth-staff-block {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    padding: 14px 16px;
    border-radius: 10px;
    line-height: 1.7;
    font-size: 14px;
}

.auth-staff-block .auth-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.auth-btn-outline, .auth-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

.auth-btn-outline {
    border: 1px solid var(--v-border);
    background: #fff;
    color: #334155;
}

.auth-btn-danger {
    border: none;
    background: #dc2626;
    color: #fff;
}

.auth-verify-box {
    margin-top: 12px;
    padding: 10px 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    word-break: break-all;
    font-size: 12px;
}

.auth-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}
