/* Login page: temporary password reveal control and visual polish */

/* Card */
.login-card {
    border: 1px solid rgb(15 23 42 / 0.06);
    border-radius: 0.75rem;
    box-shadow: 0 20px 45px -22px rgb(15 23 42 / 0.45);
}

.dark .login-card {
    border-color: rgb(255 255 255 / 0.08);
    box-shadow: 0 20px 45px -22px rgb(0 0 0 / 0.65);
}

.login-subtitle {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: rgb(var(--muted));
}

/* Inputs */
.login-field input {
    height: 2.75rem;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Password wrapper */
.login-password {
    position: relative;
}

/* Room for the toggle button */
.login-password input {
    padding-right: 2.75rem;
}

.login-password-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 2.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(var(--muted));
    border-radius: 0 0.5rem 0.5rem 0;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.login-password-toggle:hover {
    color: rgb(var(--color-primary));
    background-color: rgb(var(--color-primary) / 0.06);
}

.login-password-toggle:focus-visible {
    outline: 2px solid rgb(var(--color-primary) / 0.6);
    outline-offset: -2px;
}

.login-password-toggle i {
    font-size: 1.125rem;
    line-height: 1;
}

.dark .login-password-toggle:hover {
    background-color: rgb(255 255 255 / 0.06);
    color: rgb(255 255 255 / 0.85);
}

.login-password.is-revealed .login-password-toggle {
    color: rgb(var(--color-primary));
}

/* Countdown bar shown while the password is visible */
.login-reveal-bar {
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 2px;
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    pointer-events: none;
    opacity: 0;
}

.login-reveal-bar span {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    background-color: rgb(var(--color-primary));
}

.login-reveal-bar.is-running {
    opacity: 1;
}

.login-reveal-bar.is-running span {
    animation-name: login-reveal-countdown;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes login-reveal-countdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Submit button */
.login-submit {
    width: 100%;
    height: 2.75rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 20px -12px rgb(var(--color-primary) / 0.9);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.login-submit:hover {
    filter: brightness(1.08);
}

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

/* Screen reader only helper (announces the reveal state) */
.login-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .login-submit,
    .login-field input,
    .login-password-toggle {
        transition: none;
    }
}
