/**
 * Telas de autenticação — Plataforma Abelle
 */
:root {
    --auth-primary: var(--abelle-vinho);
    --auth-primary-dark: var(--abelle-vinho-dark);
    --auth-primary-light: var(--abelle-vinho-light);
    --auth-accent-slate: var(--abelle-slate);
    --auth-card-bg: #ffffff;
    --auth-text: #1e293b;
    --auth-text-muted: #64748b;
    --auth-border: #e8e0e4;
    --auth-radius: 16px;
    --auth-shadow: 0 25px 50px -12px rgba(46, 32, 40, 0.28);
    --auth-font: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: var(--auth-font);
    color: var(--auth-text);
    background-color: var(--abelle-plum);
    background-image:
        linear-gradient(
            145deg,
            rgba(94, 60, 80, 0.88) 0%,
            rgba(107, 68, 88, 0.78) 45%,
            rgba(69, 101, 112, 0.72) 100%
        ),
        var(--auth-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow-x: hidden;
}

body.auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 85%, rgba(139, 94, 110, 0.25) 0%, transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.auth-wrapper {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    border-top: 4px solid var(--auth-primary);
}

.auth-card__header {
    padding: 2rem 2rem 0.5rem;
    text-align: center;
}

.auth-card__logo {
    display: inline-block;
    max-width: 220px;
}

.auth-card__logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.auth-card__body {
    padding: 1rem 2rem 2rem;
}

.auth-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--auth-text);
    text-align: center;
}

.auth-card__subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    text-align: center;
    line-height: 1.5;
}

.auth-badge {
    display: block;
    width: fit-content;
    margin: 0 auto 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--auth-primary);
    background: var(--abelle-vinho-muted);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(107, 68, 88, 0.2);
}

.auth-form-group {
    margin-bottom: 1.15rem;
}

.auth-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-text);
    margin-bottom: 0.4rem;
}

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

.auth-input-wrap .auth-input {
    padding-right: 2.75rem;
}

.auth-input {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--auth-text);
    background: #faf8f9;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--abelle-vinho-muted);
}

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

.auth-toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--auth-text-muted);
    line-height: 1;
    font-size: 1.1rem;
}

.auth-toggle-password:hover {
    color: var(--auth-primary);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--auth-text-muted);
    user-select: none;
}

.auth-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-link {
    font-size: 0.875rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.auth-btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 4px 14px rgba(107, 68, 88, 0.35);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(107, 68, 88, 0.45);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.auth-btn--secondary {
    background: #f8f5f7;
    color: var(--auth-primary-dark);
    box-shadow: none;
    border: 1px solid var(--auth-border);
}

.auth-btn--secondary:hover {
    background: var(--abelle-vinho-muted);
    box-shadow: none;
}

.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.auth-alert--success {
    background: #f0fdf6;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-left: 3px solid var(--auth-accent-slate);
}

.auth-alert--danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-left: 3px solid var(--auth-primary);
}

.auth-alert--info {
    background: #f8f5f7;
    color: var(--auth-primary-dark);
    border: 1px solid #e8d5df;
    border-left: 3px solid var(--auth-accent-slate);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auth-footer a {
    color: #fff;
    font-weight: 500;
    text-decoration: none;
}

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

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

@media (max-width: 480px) {
    .auth-card__header,
    .auth-card__body {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    body.auth-page {
        background-attachment: scroll;
    }
}
