* {
    box-sizing: border-box;
}

:root[data-theme="dark"] {
    --bg1: #020617;
    --bg2: #0f172a;
    --bg3: #0f766e;
    --card: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 255, 255, 0.2);
    --text: #f8fafc;
    --muted: #cbd5e1;
    --input: rgba(255, 255, 255, 0.13);
    --input-border: rgba(255, 255, 255, 0.22);
    --link: #93c5fd;
}

:root[data-theme="light"] {
    --bg1: #dbeafe;
    --bg2: #ecfeff;
    --bg3: #d1fae5;
    --card: rgba(255, 255, 255, 0.72);
    --card-border: rgba(255, 255, 255, 0.85);
    --text: #0f172a;
    --muted: #475569;
    --input: rgba(255, 255, 255, 0.88);
    --input-border: #dbe3ef;
    --link: #2563eb;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
}

body.sa-body {
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(
            circle at 15% 18%,
            rgba(37, 99, 235, 0.36),
            transparent 28%
        ),
        radial-gradient(
            circle at 82% 22%,
            rgba(16, 185, 129, 0.34),
            transparent 30%
        ),
        linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
    transition: 0.35s ease;
}

.sa-page {
    width: 100vw;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 2;
}

.sa-card {
    width: 100%;
    max-width: 430px;
    padding: 38px;
    border-radius: 30px;
    background: var(--card);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    box-shadow:
        0 35px 90px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    animation: saCardIn 0.7s ease both;
}

@keyframes saCardIn {
    from {
        opacity: 0;
        transform: translateY(34px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sa-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.sa-logo {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #10b981, #2563eb);
    color: white;
    font-size: 34px;
    font-weight: 900;
    box-shadow: 0 22px 45px rgba(37, 99, 235, 0.42);
    animation: saFloat 3s ease-in-out infinite;
}

@keyframes saFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-8px) rotate(-3deg);
    }
}

.sa-brand h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1px;
}

.sa-brand p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.sa-group {
    margin-bottom: 18px;
}

.sa-group label {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
    margin-bottom: 8px;
}

.sa-group input {
    width: 100%;
    height: 54px;
    border-radius: 17px;
    border: 1px solid var(--input-border);
    background: var(--input);
    color: var(--text);
    padding: 0 16px;
    font-size: 15px;
    font-weight: 700;
    outline: none;
    transition: 0.25s ease;
}

.sa-group input::placeholder {
    color: #94a3b8;
}

.sa-group input:focus {
    border-color: #34d399;
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18);
    transform: translateY(-1px);
}

.sa-group p {
    margin: 7px 0 0;
    color: #fca5a5;
    font-size: 13px;
    font-weight: 800;
}

.sa-success {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
    font-weight: 800;
    margin-bottom: 16px;
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.sa-btn {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #10b981, #2563eb);
    color: white;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 20px 42px rgba(37, 99, 235, 0.38);
    transition: 0.25s ease;
    overflow: hidden;
    position: relative;
}

.sa-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    left: -120%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.32),
        transparent
    );
    transition: 0.5s ease;
}

.sa-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 26px 55px rgba(37, 99, 235, 0.5);
}

.sa-btn:hover::before {
    left: 120%;
}

.sa-btn-arrow {
    transition: 0.25s ease;
}

.sa-btn:hover .sa-btn-arrow {
    transform: translateX(5px);
}

.sa-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.sa-footer a {
    color: var(--link);
    text-decoration: none;
    font-weight: 900;
}

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

.sa-footer small {
    color: var(--muted);
    font-weight: 700;
}

.sa-theme-toggle {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 10;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    background: var(--card);
    backdrop-filter: blur(18px);
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.sa-bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(26px);
    opacity: 0.55;
    animation: saOrb 7s ease-in-out infinite;
}

.sa-orb-one {
    width: 320px;
    height: 320px;
    background: #2563eb;
    top: -90px;
    left: -80px;
}

.sa-orb-two {
    width: 380px;
    height: 380px;
    background: #10b981;
    right: -110px;
    top: 80px;
    animation-delay: 1.5s;
}

.sa-orb-three {
    width: 260px;
    height: 260px;
    background: #14b8a6;
    bottom: -80px;
    left: 45%;
    animation-delay: 2.4s;
}

@keyframes saOrb {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-28px) scale(1.06);
    }
}

/* OTP field support */
input[name="otp"] {
    text-align: center;
    letter-spacing: 10px;
    font-size: 24px;
    font-weight: 900;
}

@media (max-width: 576px) {
    .sa-page {
        padding: 16px;
    }

    .sa-card {
        padding: 28px 22px;
        border-radius: 26px;
    }

    .sa-brand {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .sa-logo {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
        font-size: 30px;
    }

    .sa-brand h1 {
        font-size: 27px;
    }

    .sa-group input,
    .sa-btn {
        height: 52px;
    }

    input[name="otp"] {
        letter-spacing: 7px;
        font-size: 21px;
    }

    .sa-theme-toggle {
        top: 14px;
        right: 14px;
    }
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap input {
    padding-right: 54px !important;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.14);
    cursor: pointer;
    font-size: 18px;
    display: grid;
    place-items: center;
    transition: 0.25s ease;
    animation: floatingEye 2.4s ease-in-out infinite;
}

.toggle-password:hover,
.toggle-password.active {
    background: linear-gradient(135deg, #10b981, #2563eb);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 12px 26px rgba(16, 185, 129, 0.35);
}

.auth-password-wrap:focus-within .toggle-password {
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18);
}

.auth-password-wrap input:focus {
    border-color: #34d399 !important;
    box-shadow:
        0 0 0 5px rgba(52, 211, 153, 0.2),
        0 14px 34px rgba(16, 185, 129, 0.18) !important;
}

@keyframes floatingEye {
    0%,
    100% {
        margin-top: 0;
    }

    50% {
        margin-top: -5px;
    }
}

.sa-forgot-link {
    margin-top: 14px;
    text-align: right;
}

.sa-forgot-link a {
    color: #4338ca;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

.sa-forgot-link a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Dark Mode */
[data-theme="dark"] .sa-forgot-link a {
    color: #c4b5fd;
}

[data-theme="dark"] .sa-forgot-link a:hover {
    color: #ffffff;
}
