.scene {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 20px;
    background:
        radial-gradient(
            1200px 600px at 15% 20%,
            rgba(255, 255, 255, 0.35),
            transparent 60%
        ),
        radial-gradient(
            900px 500px at 85% 80%,
            rgba(63, 76, 42, 0.15),
            transparent 55%
        ),
        linear-gradient(
            155deg,
            #eef1e2 0%,
            #dfe6cf 35%,
            #cdd8bd 65%,
            #b9c7a8 100%
        );
}

.auth-card {
        margin-top: 6rem;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    background: var(--bg-transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card-hover);
    padding: 36px 32px 32px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
    img {
        width: 120px;
    }
}

.auth-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}
.auth-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--primary-color);
}

.auth-card h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.auth-card p.subtitle {
    text-align: center;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--secondary-color);
    margin-bottom: 26px;
    padding: 0 6px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    height: 48px;
    transition:
        border-color var(--transition-base),
        box-shadow var(--transition-base);
}
.field:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(63, 76, 42, 0.1);
}

.field svg.leading-icon {
    width: 16px;
    height: 16px;
    stroke: var(--secondary-color);
    flex-shrink: 0;
    margin-right: 10px;
}

.field input {
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-color);
    width: 100%;
    height: 100%;
}
.field input::placeholder {
    color: #97a08a;
}

.toggle-visibility {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    flex-shrink: 0;
    color: var(--secondary-color);
}
.toggle-visibility svg {
    width: 17px;
    height: 17px;
    stroke: var(--secondary-color);
}
.toggle-visibility:hover svg {
    stroke: var(--primary-color);
}

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
}
.terms-row input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
    cursor: pointer;
}
.terms-row label {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--secondary-color);
}
.terms-row a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

.submit-btn {
    margin-top: 6px;
    height: 50px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--primary-color);
    color: var(--white);
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        background var(--transition-base),
        transform var(--transition-base);
}
.submit-btn:hover {
    background: #4d5c34;
}
.submit-btn:active {
    transform: scale(0.98);
}

.signin-link {
    text-align: center;
    font-size: 13px;
    color: var(--secondary-color);
    margin-top: 18px;
}
.signin-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.signin-link a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 22px 26px;
        max-width: 100%;
    }
    .auth-card h1 {
        font-size: 22px;
    }
    .notice {
        padding: 16px;
        gap: 12px;
    }
    .notice p {
        font-size: 13.5px;
    }
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
}

.error-message {
    display: none;
    font-size: 12.5px;
    line-height: 1.4;
    color: #d9534f;
    margin-top: 2px;
}
.field-group.has-error .error-message {
    display: block;
}
.field-group.has-error .field {
    border-color: #d9534f;
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.08);
}

.form-alert {
    background: #fdf3f3;
    border: 1px solid #d9534f;
    border-radius: var(--radius-sm);
    color: #d9534f;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ---------- Security notice ---------- */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin: 10px;
}

.notice-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notice-icon svg {
    width: 17px;
    height: 17px;
    stroke: var(--primary-color);
}

.notice p {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-color);
    padding-top: 2px;
}

/* ---------- OTP inputs ---------- */
.otp-group {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 26px;
}

.otp-box {
    width: 58px;
    height: 58px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--white);
    text-align: center;
    font-family: var(--font-family);
    font-size: 22px;
    font-weight: 600;
    color: var(--primary-color);
    outline: none;
    transition:
        border-color var(--transition-base),
        box-shadow var(--transition-base),
        transform 0.15s ease;
    caret-color: var(--primary-color);
}

.otp-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(63, 76, 42, 0.12);
}

.otp-box.filled {
    border-color: var(--primary-color);
}

/* pop animation when a digit lands */
.otp-box.pop {
    animation: otpPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes otpPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.14);
    }
    100% {
        transform: scale(1);
    }
}

/* gentle shake for error state, wired up but unused by default */
.otp-group.shake {
    animation: otpShake 0.4s ease;
}
@keyframes otpShake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-6px);
    }
    40% {
        transform: translateX(6px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}

@media (max-width: 420px) {
    .otp-group {
        gap: 10px;
    }
    .otp-box {
        width: 48px;
        height: 48px;
        font-size: 19px;
    }
}

.resend-row {
    margin-top: 20px;
    font-size: 13px;
    color: var(--secondary-color);
}
.resend-row a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.resend-row a:hover {
    text-decoration: underline;
}
.resend-row a.is-disabled {
    color: var(--secondary-color);
    pointer-events: none;
    text-decoration: none;
}

.auth-img {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
}

a.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
    color: var(--white);
}

/* 404 start */
.notfound {
    width: 100%;
    max-width: 560px;
    text-align: center;
    padding: clamp(24px, 6vw, 48px) 24px;
    display: grid;
    justify-items: center;
    gap: 14px;
}

.notfound-code {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: clamp(9rem, 18vw, 18rem);
    line-height: 1;
    color: var(--primary-color);
    letter-spacing: 0.02em;
}

.notfound-title {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: clamp(22px, 3.6vw, 30px);
    color: var(--primary-color);
}

.notfound-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.75;
    max-width: 34ch;
    margin-top: 4px;
}

.notfound-cta {
    appearance: none;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: var(--white);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    padding: 15px 28px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    text-decoration: none;
    margin-top: 14px;
    transition:
        background var(--transition-base),
        transform var(--transition-base),
        box-shadow var(--transition-base);
}

.notfound-cta:hover {
    background: #333f22;
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
    color: #fff;
}

.notfound-cta svg {
    width: 16px;
    height: 16px;
}

/* ===== Mobile ===== */
@media (max-width: 420px) {
    .notfound-desc {
        font-size: 14px;
    }
    .notfound-cta {
        width: 100%;
        justify-content: center;
    }
}

.scene .notfound {
    /* From https://css.glass */
    background: rgba(255, 255, 255, 0.32);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12.4px);
    -webkit-backdrop-filter: blur(12.4px);
}
