
/* =========================================================
   AstraNovels — Autenticación
   Login y registro
   ========================================================= */

.auth-main {
    width: min(100% - 2rem, 440px);
    margin: 3rem auto;
    color: var(--text);
}

.auth-main--signup {
    max-width: 480px;
}

.auth-card {
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid color-mix(
        in srgb,
        var(--accent) 24%,
        var(--page)
    );
    border-radius: 1.25rem;
    background: var(--page);
    box-shadow: 0 12px 36px
        color-mix(in srgb, var(--text) 9%, transparent);
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: .5rem;
    color: var(--text);
}

.auth-description {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-field {
    display: grid;
    gap: .4rem;
}

.auth-field label {
    color: var(--text);
    font-weight: 600;
}

.auth-field input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: .8rem .9rem;
    border: 1px solid color-mix(
        in srgb,
        var(--accent) 28%,
        var(--page)
    );
    border-radius: .7rem;
    background: var(--page);
    color: var(--text);
    font: inherit;
    color-scheme: light;
    transition: border-color .2s ease, box-shadow .2s ease;
}

:root[data-theme="dark"] .auth-field input {
    color-scheme: dark;
}

.auth-field input:focus {
    border-color: var(--accent);
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-field small {
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.5;
}

.auth-error {
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border: 1px solid #e9a4ae;
    border-radius: .7rem;
    background: #fff0f1;
    color: #8c2636;
}

.auth-error ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
}

:root[data-theme="dark"] .auth-error {
    border-color: #8f4657;
    background: #351923;
    color: #ffdce3;
}

.auth-submit {
    width: 100%;
    margin-top: .3rem;
    cursor: pointer;
}

.auth-switch {
    margin-top: 1.3rem;
    margin-bottom: 0;
    color: var(--muted);
    text-align: center;
}

.auth-switch a {
    color: var(--accent-strong);
    font-weight: 600;
}

:root[data-theme="dark"] .auth-switch a {
    color: var(--accent);
}

.auth-switch a:hover {
    text-decoration: underline;
}

@media (max-width: 540px) {
    .auth-main {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .auth-card {
        padding: 1.25rem;
    }
}


/* Botón principal de autenticación */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: .3rem;
    padding: .85rem 1.2rem;

    border: 1px solid transparent;
    border-radius: .8rem;

    background: linear-gradient(
        135deg,
        var(--accent),
        var(--accent-strong)
    );

    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
    box-shadow: 0 5px 14px
        color-mix(in srgb, var(--accent) 22%, transparent);

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        filter .2s ease;
}

.auth-submit:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px
        color-mix(in srgb, var(--accent) 30%, transparent);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}

.auth-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
