:root {
    --dental-blue-50: #f0f9ff;
    --dental-blue-100: #e0f2fe;
    --dental-blue-200: #bae6fd;
    --dental-blue-500: #0ea5e9;
    --dental-blue-600: #0284c7;
    --dental-blue-700: #0369a1;
    --dental-blue-800: #075985;
    --dental-slate-200: #e2e8f0;
    --dental-slate-400: #94a3b8;
    --dental-slate-500: #64748b;
    --dental-slate-700: #334155;
    --dental-slate-800: #1e293b;
    --dental-font: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

.tooth-login-page,
.tooth-login-page *,
.tooth-login-page *::before,
.tooth-login-page *::after {
    box-sizing: border-box;
}

body.tooth-login-page {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--dental-slate-800);
    background:
        radial-gradient(circle at 86% 8%, rgba(125, 211, 252, 0.42), transparent 32rem),
        radial-gradient(circle at 9% 91%, rgba(165, 180, 252, 0.34), transparent 30rem),
        linear-gradient(145deg, #f8fbff 0%, #eef8ff 48%, #f8fafc 100%);
    font-family: var(--dental-font);
}

.dental-background {
    position: fixed;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.dental-orb {
    position: absolute;
    width: 24rem;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
}

.dental-orb-one {
    top: -10rem;
    right: -8rem;
    background: #38bdf8;
}

.dental-orb-two {
    bottom: -12rem;
    left: -8rem;
    background: #818cf8;
}

.dental-sparkle {
    position: absolute;
    color: rgba(2, 132, 199, 0.2);
    animation: dental-float 6s ease-in-out infinite;
}

.dental-sparkle-one {
    top: 16%;
    left: 12%;
    font-size: 1.25rem;
}

.dental-sparkle-two {
    top: 68%;
    right: 10%;
    font-size: 1rem;
    animation-delay: -2s;
}

.dental-sparkle-three {
    bottom: 10%;
    left: 9%;
    font-size: 2rem;
    animation-delay: -4s;
}

.login-stage {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    place-items: center;
    padding: 18px 12px;
}

.tooth-card {
    position: relative;
    width: min(100%, 500px);
    min-height: 720px;
    isolation: isolate;
    transition: transform 220ms ease;
}

.tooth-card:hover {
    transform: translateY(-2px);
}

.tooth-frame {
    position: absolute;
    z-index: -1;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.tooth-glint {
    position: absolute;
    top: 7.5%;
    right: 20%;
    color: var(--dental-blue-500);
    font-size: 0.8rem;
    animation: enamel-glint 3.6s ease-in-out infinite;
}

.tooth-content {
    width: min(63%, 312px);
    margin-inline: auto;
    padding-block: 40px 208px;
    text-align: center;
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 11px;
}

.clinic-mark {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 7px;
    place-items: center;
    color: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--dental-blue-500), var(--dental-blue-700));
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.28), inset 0 2px 3px rgba(255, 255, 255, 0.4);
}

.clinic-mark i {
    font-size: 1.45rem;
}

.login-header h1 {
    margin: 0;
    color: var(--dental-slate-800);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
}

.login-header p {
    margin: 2px 0 0;
    color: var(--dental-slate-500);
    font-size: 0.82rem;
    font-weight: 600;
}

.login-alerts {
    max-height: 88px;
    margin-bottom: 8px;
    overflow-y: auto;
    scrollbar-color: var(--dental-blue-200) transparent;
    scrollbar-width: thin;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 6px 11px;
    color: var(--dental-blue-800);
    border-inline-start: 3px solid var(--dental-blue-500);
    border-radius: 9px;
    background: var(--dental-blue-50);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: start;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.08);
}

.login-alert-error {
    color: #9f1239;
    border-inline-start-color: #f43f5e;
    background: #fff1f2;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: start;
}

.login-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    color: var(--dental-slate-700);
    font-size: 0.82rem;
    font-weight: 700;
}

.login-field label i {
    color: var(--dental-blue-600);
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 38px 0 40px;
    color: var(--dental-slate-800);
    border: 1.5px solid var(--dental-slate-200);
    border-radius: 12px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.035);
    font: 500 0.86rem var(--dental-font);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.login-input-wrap input::placeholder {
    color: var(--dental-slate-400);
}

.login-input-wrap input:focus {
    border-color: var(--dental-blue-500);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.login-input-wrap input[aria-invalid="true"] {
    border-color: #fb7185;
}

.login-input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 13px;
    color: var(--dental-slate-400);
    transform: translateY(-50%);
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    left: 8px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: var(--dental-slate-400);
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--dental-blue-700);
    background: var(--dental-blue-50);
}

.login-field-error {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin: 4px 0 0;
    color: #be123c;
    font-size: 0.74rem;
    font-weight: 600;
}

.login-submit {
    display: flex;
    width: 100%;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    color: #ffffff;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--dental-blue-500), var(--dental-blue-700));
    box-shadow: 0 7px 18px rgba(2, 132, 199, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.35);
    font: 700 0.92rem var(--dental-font);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.38);
}

.login-submit:active {
    transform: translateY(0);
}

.password-toggle:focus-visible,
.login-submit:focus-visible,
.login-footer a:focus-visible {
    outline: 3px solid rgba(14, 165, 233, 0.42);
    outline-offset: 3px;
}

.login-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 11px;
    color: var(--dental-slate-500);
    font-size: 0.78rem;
}

.login-footer a {
    color: var(--dental-blue-700);
    font-weight: 700;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

@keyframes dental-float {
    0%, 100% { transform: translateY(0) rotate(0); opacity: 0.18; }
    50% { transform: translateY(-14px) rotate(16deg); opacity: 0.45; }
}

@keyframes enamel-glint {
    0%, 100% { transform: scale(0.7) rotate(0); opacity: 0.25; }
    50% { transform: scale(1.25) rotate(40deg); opacity: 0.95; filter: drop-shadow(0 0 8px #38bdf8); }
}

@media (max-width: 520px) {
    .login-stage {
        padding-inline: 6px;
    }

    .tooth-card {
        min-height: 690px;
    }

    .tooth-content {
        width: min(70%, 290px);
        padding-block: 36px 200px;
    }

    .clinic-mark {
        width: 48px;
        height: 48px;
        margin-bottom: 6px;
    }

    .clinic-mark i {
        font-size: 1.3rem;
    }

    .login-header {
        margin-bottom: 10px;
    }

    .login-header h1 {
        font-size: 1.12rem;
    }

    .login-header p,
    .login-field label {
        font-size: 0.76rem;
    }

    .login-form {
        gap: 9px;
    }

    .login-input-wrap input {
        height: 40px;
        font-size: 0.82rem;
    }

    .login-submit {
        height: 42px;
        font-size: 0.88rem;
    }

    .login-footer {
        margin-top: 10px;
        font-size: 0.74rem;
    }
}

@media (max-width: 360px) {
    .tooth-content {
        width: 76%;
    }

    .login-header h1 {
        font-size: 1rem;
    }

    .login-input-wrap input {
        font-size: 0.76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tooth-card,
    .dental-sparkle,
    .tooth-glint,
    .login-submit,
    .login-input-wrap input {
        animation: none;
        transition: none;
    }
}
