/* AccuCore multi-tenant auth — OTP login + context selection (RTL) */

:root {
    --ac-primary: #0891b2;
    --ac-primary-dark: #0e7490;
    --ac-secondary: #22d3ee;
    --ac-cta: #059669;
    --ac-bg: #ecfeff;
    --ac-text: #164e63;
    --ac-muted: #475569;
    --ac-surface: rgba(255, 255, 255, 0.78);
    --ac-border: rgba(8, 145, 178, 0.22);
    --ac-font: var(--app-font-family, "Vazirmatn", Tahoma, sans-serif);
    --ac-radius: 20px;
    --ac-focus: 0 0 0 3px rgba(8, 145, 178, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

.ac-auth-body {
    min-height: 100dvh;
    margin: 0;
    font-family: var(--ac-font);
    color: var(--ac-text);
    background: var(--ac-bg);
    line-height: 1.7;
    position: relative;
}

.ac-auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 10% 20%, rgba(34, 211, 238, 0.35), transparent 55%),
        radial-gradient(ellipse 50% 45% at 90% 80%, rgba(8, 145, 178, 0.22), transparent 50%),
        linear-gradient(160deg, #ecfeff 0%, #f0f9ff 45%, #e0f2fe 100%);
    animation: ac-wash 18s ease-in-out infinite alternate;
}

@keyframes ac-wash {
    from { transform: scale(1); }
    to { transform: scale(1.04) translate(-1%, 0.5%); }
}

@media (prefers-reduced-motion: reduce) {
    .ac-auth-bg { animation: none; }
    .ac-context-card { transition: none !important; }
}

.ac-auth-shell {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    margin: 0 auto;
    padding: 2rem 1rem 2.5rem;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
}

.ac-auth-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100dvh;
    max-width: 1180px;
    margin: 0 auto;
    gap: 0;
}

.ac-auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 2.25rem;
    gap: 1rem;
}

.ac-auth-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 2.75rem;
    position: relative;
    overflow: hidden;
}

.ac-auth-hero-glow {
    position: absolute;
    top: -20%;
    left: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.16) 0%, transparent 65%);
    pointer-events: none;
}

.ac-auth-hero-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.ac-auth-hero-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 20px rgba(8, 145, 178, 0.25));
}

.ac-auth-hero-logo svg { width: 100%; height: 100%; display: block; }

.ac-auth-hero-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(145deg, #0891b2 0%, #0e7490 55%, #164e63 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.ac-auth-hero-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--ac-muted);
    font-weight: 500;
}

.ac-auth-hero-intro {
    position: relative;
    margin-bottom: 1.75rem;
}

.ac-auth-hero-intro p {
    margin: 0;
    color: var(--ac-muted);
    font-size: 0.98rem;
    line-height: 1.85;
}

.ac-auth-hero-features {
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    display: grid;
    gap: 0.85rem;
    position: relative;
}

.ac-auth-hero-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(8, 145, 178, 0.14);
    font-size: 0.95rem;
    font-weight: 500;
}

.ac-feature-icon { font-size: 1.2rem; line-height: 1; }

.ac-auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(8, 145, 178, 0.18);
    font-size: 0.82rem;
    color: var(--ac-muted);
    width: fit-content;
    position: relative;
}

.ac-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.ac-auth-switch {
    margin-top: 0.35rem;
}

.ac-btn--block { width: 100%; }

.ac-auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    justify-content: center;
    margin-top: 0.35rem;
}

.ac-auth-links a {
    color: var(--ac-primary-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.ac-auth-links a:hover { text-decoration: underline; }

.ac-auth-footer {
    text-align: center;
    color: var(--ac-muted);
    font-size: 0.82rem;
}

.ac-auth-shell--wide {
    width: min(720px, 100%);
}

.ac-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.ac-auth-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.ac-auth-logo svg { width: 100%; height: 100%; }

.ac-auth-product {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ac-primary-dark);
}

.ac-auth-title {
    margin: 0.1rem 0 0;
    font-size: clamp(1.45rem, 3vw, 1.75rem);
    font-weight: 700;
    color: var(--ac-text);
}

.ac-auth-panel {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 1.5rem 1.35rem;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(22, 78, 99, 0.08);
    animation: ac-rise 0.45s ease-out both;
}

@keyframes ac-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.ac-auth-lead {
    margin: 0 0 1.15rem;
    color: var(--ac-muted);
    font-size: 0.98rem;
}

.ac-auth-foot {
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--ac-muted);
}

.ac-form { display: flex; flex-direction: column; gap: 1rem; }

.ac-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.ac-input {
    width: 100%;
    border: 1.5px solid rgba(8, 145, 178, 0.28);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--ac-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ac-input:focus {
    outline: none;
    border-color: var(--ac-primary);
    box-shadow: var(--ac-focus);
}

.ac-input--otp {
    letter-spacing: 0.35em;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 600;
}

.ac-mobile-display {
    margin: 0;
    font-weight: 600;
    direction: ltr;
    text-align: right;
}

.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 48px;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.ac-btn--primary {
    background: var(--ac-cta);
    color: #fff;
}

.ac-btn--primary:hover { background: #047857; color: #fff; }

.ac-btn--ghost {
    background: transparent;
    color: var(--ac-primary-dark);
    border: 1.5px solid rgba(8, 145, 178, 0.35);
}

.ac-btn--ghost:hover { background: rgba(8, 145, 178, 0.08); }

.ac-btn:focus-visible { outline: none; box-shadow: var(--ac-focus); }

.ac-alert {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.ac-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.ac-alert--info {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

.ac-muted { color: var(--ac-muted); font-size: 0.9rem; }

.ac-context-grid {
    display: grid;
    gap: 0.75rem;
}

.ac-context-form { margin: 0; }

.ac-context-card {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    text-align: right;
    padding: 1rem 1.05rem;
    border-radius: 14px;
    border: 1.5px solid rgba(8, 145, 178, 0.2);
    background: #fff;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    animation: ac-rise 0.5s ease-out both;
}

.ac-context-form:nth-child(2) .ac-context-card { animation-delay: 0.06s; }
.ac-context-form:nth-child(3) .ac-context-card { animation-delay: 0.12s; }
.ac-context-form:nth-child(4) .ac-context-card { animation-delay: 0.18s; }

.ac-context-card:hover {
    border-color: var(--ac-primary);
    background: #f0fdfa;
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.12);
}

.ac-context-card:focus-visible {
    outline: none;
    box-shadow: var(--ac-focus);
}

.ac-context-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(8, 145, 178, 0.12);
    color: var(--ac-primary-dark);
}

.ac-context-icon svg { width: 22px; height: 22px; }

.ac-context-card--doctor .ac-context-icon { background: rgba(5, 150, 105, 0.12); color: #047857; }
.ac-context-card--staff .ac-context-icon,
.ac-context-card--receptionist .ac-context-icon { background: rgba(2, 132, 199, 0.12); color: #0369a1; }
.ac-context-card--patient .ac-context-icon { background: rgba(14, 116, 144, 0.12); color: #0e7490; }

.ac-context-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.ac-context-text strong {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-context-text small {
    font-size: 0.88rem;
    color: var(--ac-muted);
}

.ac-context-arrow {
    color: var(--ac-primary);
    font-size: 1.1rem;
}

.ac-session-meta {
    margin: 0 0 1rem;
    display: grid;
    gap: 0.65rem;
}

.ac-session-meta > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(8, 145, 178, 0.12);
}

.ac-session-meta dt {
    margin: 0;
    color: var(--ac-muted);
    font-size: 0.9rem;
}

.ac-session-meta dd {
    margin: 0;
    font-weight: 600;
}

.ac-tenant-note { margin-bottom: 1.25rem; }

@media (max-width: 560px) {
    .ac-auth-shell { padding-top: 1.25rem; }
    .ac-auth-panel { padding: 1.2rem 1rem; }
    .ac-auth-layout {
        grid-template-columns: 1fr;
    }
    .ac-auth-hero {
        padding: 1.5rem 1rem 0.5rem;
    }
    .ac-auth-main {
        padding: 1rem 1rem 1.5rem;
    }
    .ac-auth-hero-features {
        gap: 0.55rem;
    }
    .ac-auth-hero-features li {
        padding: 0.7rem 0.85rem;
        font-size: 0.88rem;
    }
}
