*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body.auth-body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at 5% 40%, rgba(var(--color-primary-rgb), 0.85), rgba(var(--color-secondary-rgb), 1));
    color: var(--color-contrast);
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(360px, 1fr);
    width: min(1100px, 100%);
    margin: 2rem;
    border-radius: 32px;
    overflow: hidden;
    background: rgba(var(--color-secondary-rgb), 0.65);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    box-shadow: 0 40px 120px rgba(var(--color-secondary-rgb), 0.55);
    max-height: calc(100vh - 4rem);
}

.auth-card {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: rgba(var(--color-secondary-rgb), 0.75);
    overflow: visible;
    min-height: 0;
}

.auth-brand {
    text-align: left;
}

.auth-brand h1 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: font-size 0.3s ease;
}

.auth-card--has-alert .auth-brand h1 {
    font-size: 1.3rem;
}

.auth-brand p {
    margin: 0;
    color: var(--color-contrast-muted);
}

.auth-logo {
    position: relative;
    width: 200px;
    height: 80px;
    border-radius: 24px;
    
    display: grid;
    place-items: center;
    overflow: hidden;
}

.auth-logo-letter {
    position: relative;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-secondary);
}

.auth-logo img {
    position: relative;
    width: 200px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(var(--color-secondary-rgb), 0.25));
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 0;
    flex: 1;
}

.auth-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-contrast-strong);
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    background: rgba(var(--color-secondary-rgb), 0.65);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-wrapper:focus-within {
    border-color: rgba(var(--color-primary-rgb), 0.7);
    box-shadow: 0 0 0 4px rgba(var(--color-primary-rgb), 0.18);
}

.auth-input-icon {
    margin-right: 0.75rem;
    font-size: 0.95rem;
    color: var(--color-contrast-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
}

.auth-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--color-contrast);
    font-size: 1rem;
    outline: none;
}

.auth-toggle-password {
    border: none;
    background: transparent;
    color: var(--color-contrast-soft);
    cursor: pointer;
    padding: 0;
    display: grid;
    place-items: center;
}

.auth-toggle-password:hover {
    color: var(--color-contrast);
}

.auth-submit {
    position: relative;
    border: none;
    border-radius: 18px;
    padding: 0.95rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--color-contrast);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: auto;
}

.auth-submit-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-submit:hover .auth-submit-glow,
.auth-submit:focus-visible .auth-submit-glow {
    opacity: 1;
}

.auth-submit:hover {
    box-shadow: 0 16px 40px rgba(var(--color-primary-rgb), 0.45);
}

.auth-alert {
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.4;
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.auth-alert p {
    margin: 0;
}

.auth-alert p:not(:last-child) {
    margin-bottom: 0.5rem;
}

.auth-alert--info {
    background: rgba(var(--color-primary-rgb), 0.22);
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    color: #e3f4fb;
}

.auth-alert--error {
    background: rgba(255, 94, 124, 0.18);
    border: 1px solid rgba(255, 94, 124, 0.3);
    color: #ffd6df;
}

.auth-showcase {
    position: relative;
    background: linear-gradient(140deg, rgba(var(--color-secondary-rgb), 0.8), rgba(var(--color-primary-rgb), 0.35)), url('../img/inlog-plan.png') center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 3rem;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.auth-showcase-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(200deg, rgba(var(--color-secondary-rgb), 0.35), rgba(var(--color-secondary-rgb), 0.9));
}

.auth-showcase-content {
    position: relative;
    z-index: 1;
    max-width: 360px;
}

.auth-showcase-content h2 {
    margin: 0 0 1rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-contrast);
}

.auth-showcase-content p {
    margin: 0 0 1.5rem;
    color: var(--color-contrast-muted);
}

.auth-showcase-content ul {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--color-contrast-strong);
}

.auth-showcase-content li {
    margin-bottom: 0.75rem;
}

/* Imagem em destaque do tema comemorativo na tela de login */
.tema-comemorativo-login-img {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}
.tema-comemorativo-login-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* HTML customizado do tema na tela de login – conteúdo um pouco mais para dentro do widget */
.tema-comemorativo-html--login {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
}
.tema-comemorativo-html--login > * {
    max-width: 100%;
    box-sizing: border-box;
}
.tema-comemorativo-html--login img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}
.tema-comemorativo-html--login video,
.tema-comemorativo-html--login iframe {
    max-width: 100%;
}

@media (max-width: 960px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        margin: 1.5rem;
    }

    .auth-showcase {
        display: none;
    }
}

@media (max-width: 540px) {
    .auth-wrapper {
        max-height: calc(100vh - 3rem);
        margin: 1.5rem;
    }

    .auth-card {
        padding: 2.25rem 1.75rem;
    }

    .auth-brand h1 {
        font-size: 1.5rem;
    }
}

/* Modal de Aviso - Alterar Senha */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1.5rem;
    overflow-y: auto;
}


.auth-modal-overlay[data-state="closed"] {
    display: none;
}

.auth-modal {
    background: rgba(var(--color-secondary-rgb), 0.95);
    border-radius: 24px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(var(--color-primary-rgb), 0.3);
    overflow: hidden;
    animation: authModalSlideIn 0.3s ease-out;
}

@keyframes authModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-contrast);
}

.auth-modal-body {
    padding: 1.5rem 2rem;
    color: var(--color-contrast-strong);
    line-height: 1.6;
}

.auth-modal-body p {
    margin: 0 0 1rem;
}

.auth-modal-body p:last-child {
    margin-bottom: 0;
}

.auth-modal-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.auth-modal-button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-contrast);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-soft));
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.auth-modal-button:hover {
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.4);
    transform: translateY(-1px);
}

.auth-modal-button:active {
    transform: translateY(0);
}

/* Banner do tema comemorativo (login) – elegante, dourado, horizontal */
.tema-comemorativo-banner {
    --tema-gold: #f4d03f;
    --tema-gold-light: #f9e076;
    --tema-gold-dark: #e8b923;
    --tema-gold-glow: rgba(249, 224, 118, 0.6);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(105deg, rgba(0, 0, 0, 0.5) 0%, rgba(20, 15, 5, 0.7) 40%, rgba(0, 0, 0, 0.45) 100%);
    border: 1px solid rgba(244, 208, 63, 0.35);
    border-left: 5px solid var(--tema-gold);
    border-radius: 0 10px 10px 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(249, 224, 118, 0.08);
}
.tema-comemorativo-banner__img {
    flex-shrink: 0;
}
.tema-comemorativo-banner__img img {
    max-height: 48px;
    width: auto;
    display: block;
}
.tema-comemorativo-banner__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.6rem 1rem;
    justify-content: center;
}
.tema-comemorativo-banner__titulo {
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.tema-comemorativo-banner__sep {
    flex-shrink: 0;
    color: var(--tema-gold-light);
    font-size: 0.7rem;
    opacity: 1;
    filter: drop-shadow(0 0 4px var(--tema-gold-glow));
}
.tema-comemorativo-banner__ano {
    flex-shrink: 0;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    padding: 0.25rem 0.6rem;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #fffacd 0%, var(--tema-gold-light) 25%, var(--tema-gold) 50%, var(--tema-gold-dark) 75%, var(--tema-gold-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px var(--tema-gold-glow)) drop-shadow(0 0 16px rgba(244, 208, 63, 0.35));
}
.tema-comemorativo-banner__texto {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    font-weight: 400;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

