/* Auth and self-registration screens */

.auth-page {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 20px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.auth-header {
    padding: 24px 24px 16px;
}

.logo-escola {
    width: 150px;
    height: 150px;
    object-fit:cover;
}

.auth-header h1 {
    font-size: 30px;
    line-height: 1.1;
    margin-bottom: 8px;
    text-align: center;
}

.auth-header p {
    color: var(--text-muted);
    text-align: center;
}

.form {
    padding: 12px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

#erro {
    min-height: 20px;
    font-size: 14px;
    color: var(--error);
    text-align: center;
    margin-top: 4px;
}

.auth-recovery {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-recovery h3 {
    font-size: 16px;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    place-items: center;
    padding: 20px 16px;
    background: var(--overlay-scrim);
    backdrop-filter: blur(4px);
}

.auth-modal[hidden] {
    display: none;
}

.auth-modal-card {
    width: min(100%, 520px);
    max-height: min(calc(100vh - 32px), 760px);
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
    overflow: auto;
}

.auth-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-modal-header h2 {
    font-size: 26px;
    line-height: 1.1;
    margin: 8px 0 6px;
}

.auth-modal-header p:last-child {
    color: var(--text-muted);
}

.auth-modal-close {
    min-width: 108px;
}

.auth-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.auth-modal-actions .btn-destaque,
.auth-modal-actions .register-secondary-btn {
    flex: 1 1 180px;
    margin-top: 0;
}

#msgRecuperacao {
    min-height: 20px;
    font-size: 14px;
    text-align: center;
}

body.auth-modal-open {
    overflow: hidden;
}

.register-page {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 20px 16px;
}

.register-card {
    width: 100%;
    max-width: 760px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.register-header {
    padding: 24px 24px 10px;
}

.register-header h1 {
    font-size: 32px;
    line-height: 1.1;
    margin-bottom: 8px;
}

.register-header p {
    color: var(--text-muted);
}

.register-form {
    padding: 12px 24px 24px;
    display: grid;
    gap: 10px;
}

.register-required-note {
    margin: 0 0 2px;
    color: var(--text-muted);
    font-size: 14px;
}

.register-field {
    display: grid;
    gap: 6px;
}

.register-field label,
.register-fieldset legend {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.register-field-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.register-field-hint[data-valid="true"] {
    color: var(--brand-strong);
}

.register-field-hint[data-valid="false"] {
    color: var(--state-danger-text);
}

.register-field-error {
    min-height: 0;
    margin: 0;
    color: var(--state-danger-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.register-field-error:empty {
    display: none;
}

.register-fieldset {
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: 10px;
    background: var(--surface-1);
}

.register-fieldset legend {
    padding: 0 4px;
}

.register-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
    max-height: 170px;
    overflow: auto;
    padding-right: 2px;
}

.register-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-0);
    min-height: 44px;
    padding: 8px 10px;
    cursor: pointer;
}

.register-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
    flex: 0 0 16px;
}

.register-checkbox-item span {
    font-size: 14px;
    color: var(--text-main);
}

.register-secondary-btn {
    height: 44px;
    border-radius: 12px;
    border-color: var(--line-strong);
    background: var(--surface-0);
    color: var(--text-main);
}

#msgCadastro {
    min-height: 20px;
    font-size: 14px;
    text-align: center;
}

#msgCadastro[data-variant="error"] {
    color: var(--state-danger-text);
}

#msgCadastro[data-variant="success"] {
    color: var(--brand-strong);
}


@media (min-width: 768px) {
    .auth-page {
        padding: 32px;
    }

    .register-page {
        padding: 30px;
    }

    .auth-card {
        max-width: 820px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .auth-header {
        padding: 40px 32px;
        background: linear-gradient(165deg, #effcf9, #f3f6ff);
        border-right: 1px solid #e8eef6;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .auth-header h1 {
        font-size: 42px;
    }

    .form {
        justify-content: center;
        padding: 34px 30px;
    }

    .auth-modal {
        padding: 32px;
    }

    .auth-modal-card {
        padding: 28px;
    }
}

@media (max-width: 767px) {
    .auth-modal {
        align-items: end;
        padding: 12px;
    }

    .auth-modal-card {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 20px 16px 18px;
        border-radius: 22px 22px 18px 18px;
    }

    .auth-modal-header {
        flex-direction: column;
    }

    .auth-modal-close,
    .auth-modal-actions .btn-destaque,
    .auth-modal-actions .register-secondary-btn {
        width: 100%;
    }
}
