:root {
    --auth-ink: #17291f;
    --auth-muted: #667085;
    --auth-green: #198754;
    --auth-green-dark: #116a40;
    --auth-blue: #2e7ea8;
    --auth-paper: #fff7e8;
    --auth-paper-strong: #fffdf7;
    --auth-border: rgba(70, 83, 64, 0.14);
    --auth-shadow: 0 1.75rem 4.5rem rgba(28, 48, 36, 0.2);
    --auth-panel-bg: #fff8ea;
    --auth-form-bg: #fffdf8;
    --auth-form-card-width: 500px;
    --auth-experience-min-height: 550px;
    --auth-experience-max-height: 650px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 18% 15%, rgba(72, 142, 91, 0.16), transparent 28rem),
        radial-gradient(circle at 88% 84%, rgba(196, 138, 70, 0.16), transparent 30rem),
        linear-gradient(135deg, #eef5ef 0%, #f9f2df 52%, #eef3ec 100%);
    color: var(--auth-ink);
}

/* Layout auth */
.auth-wrapper,
.auth-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: clamp(0.75rem, 2.2vw, 2rem);
}

.auth-wrapper::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(110deg, rgba(255, 255, 255, 0.34), transparent 48%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.42), transparent 42rem);
}

.auth-wrapper > * {
    position: relative;
    z-index: 1;
}

/* Experiência visual login/registo */
.auth-experience {
    width: min(100%, 1180px);
    height: clamp(var(--auth-experience-min-height), calc(100vh - 4rem), var(--auth-experience-max-height));
    height: clamp(var(--auth-experience-min-height), calc(100svh - 4rem), var(--auth-experience-max-height));
    min-height: var(--auth-experience-min-height);
    max-height: var(--auth-experience-max-height);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    overflow: hidden;
    border: 1px solid rgba(84, 98, 72, 0.18);
    border-radius: clamp(1.25rem, 2.4vw, 2rem);
    background: var(--auth-paper);
    box-shadow: var(--auth-shadow);
}


.auth-visual-panel {
    position: relative;
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
    background-image: url("../img/login_bg.webp");
    background-position: center bottom;
    background-size: cover;
}

.auth-visual-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.32) 0%, rgba(252, 243, 221, 0.08) 44%, rgba(116, 92, 52, 0.05) 100%),
        radial-gradient(circle at 23% 25%, rgba(255, 255, 255, 0.7), transparent 21rem),
        radial-gradient(circle at 68% 62%, rgba(255, 255, 255, 0.14), transparent 18rem);
}

.auth-visual-panel::after,
.auth-visual-overlay {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.auth-visual-panel::after {
    background: linear-gradient(90deg, rgba(255, 247, 232, 0) 0%, rgba(255, 247, 232, 0) 68%, rgba(255, 248, 234, 0.28) 86%, var(--auth-panel-bg) 100%);
}

.auth-visual-overlay {
    background:
        linear-gradient(180deg, rgba(255, 251, 241, 0.62) 0%, rgba(255, 251, 241, 0.16) 30%, rgba(255, 251, 241, 0.02) 100%),
        radial-gradient(circle at 78% 58%, rgba(255, 255, 255, 0.2), transparent 14rem);
}

.auth-visual-content {
    position: relative;
    z-index: 3;
    width: min(48%, 350px);
    height: 100%;
    min-height: 0;
    padding: clamp(1.35rem, 2.7vw, 2.45rem);
}

.auth-visual-logo-link {
    display: inline-flex;
    max-width: 100%;
    margin-bottom: clamp(1.25rem, 2.5vw, 2.05rem);
    text-decoration: none;
}

.auth-visual-logo {
    width: min(100%, 245px);
    height: auto;
    filter: drop-shadow(0 0.7rem 1.25rem rgba(34, 49, 32, 0.18));
}

.auth-visual-copy {
    position: absolute;
    left: clamp(1.35rem, 2.7vw, 2.45rem);
    bottom: clamp(1.8rem, 4.3vw, 3.45rem);
    max-width: min(21rem, calc(100% - clamp(2.7rem, 5.4vw, 4.9rem)));
    margin-top: 0;
}

.auth-visual-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.55rem;
    border: 1px solid rgba(25, 135, 84, 0.18);
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    background: rgba(255, 255, 255, 0.46);
    color: #31523a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.auth-visual-title {
    margin: 0;
    color: #12251c;
    font-size: clamp(2.35rem, 4vw, 3.7rem);
    line-height: 0.94;
    font-weight: 900;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.auth-visual-title span {
    display: block;
}

.auth-visual-title span:nth-child(2) {
    color: var(--auth-green);
}

.auth-visual-title span:nth-child(3) {
    color: var(--auth-blue);
}

.auth-visual-subtitle {
    width: min(19rem, 100%);
    margin: clamp(0.9rem, 1.7vw, 1.15rem) 0 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.95rem;
    padding: 0.62rem 0.76rem;
    background: rgba(255, 253, 246, 0.34);
    color: #263c30;
    font-size: clamp(0.94rem, 1.08vw, 1.02rem);
    font-weight: 760;
    line-height: 1.42;
    box-shadow: 0 0.28rem 0.65rem rgba(41, 52, 35, 0.025);
    backdrop-filter: blur(2.5px);
}

.auth-visual-cookie-settings {
    position: absolute;
    z-index: 4;
    left: clamp(1.35rem, 2.7vw, 2.45rem);
    bottom: clamp(0.75rem, 1.5vw, 1.15rem);
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 2.2rem;
    border: 1px solid rgba(25, 113, 68, 0.22);
    border-radius: 999px;
    padding: 0.4rem 0.68rem;
    color: #174d31;
    background: rgba(255, 253, 246, 0.76);
    box-shadow: 0 0.3rem 0.8rem rgba(41, 52, 35, 0.08);
    backdrop-filter: blur(8px);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.auth-visual-cookie-settings:hover {
    border-color: rgba(25, 113, 68, 0.38);
    color: var(--auth-green-dark);
    background: rgba(255, 255, 255, 0.92);
    transform: translateY(-1px);
}

.auth-visual-cookie-settings:focus-visible {
    outline: 0.2rem solid rgba(25, 135, 84, 0.24);
    outline-offset: 0.12rem;
}

.auth-experience-login .auth-visual-copy,
.auth-experience-register .auth-visual-copy {
    bottom: clamp(4.35rem, 6.2vw, 5.15rem);
}

.auth-visual-mascot {
    position: absolute;
    z-index: 2;
    left: auto;
    right: clamp(0.6rem, 3.6vw, 2.2rem);
    bottom: clamp(-0.55rem, -0.35vw, -0.15rem);
    width: min(58%, 470px);
    height: auto;
    max-height: 90%;
    object-fit: contain;
    object-position: bottom right;
    filter: drop-shadow(0 1.4rem 1.4rem rgba(57, 47, 28, 0.28));
}

.auth-form-panel {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    padding: clamp(0.9rem, 2vw, 2rem);
    background:
        linear-gradient(90deg, var(--auth-panel-bg) 0%, var(--auth-form-bg) 56%, #ffffff 100%);
}

.auth-form-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -2.35rem;
    width: 2.35rem;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 248, 234, 0), rgba(255, 248, 234, 0.86));
}

.auth-form-card {
    width: min(100%, var(--auth-form-card-width));
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(42, 71, 51, 0.12);
    border-radius: 1.35rem;
    padding: clamp(1.1rem, 2vw, 1.75rem);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 0.55rem 1.25rem rgba(33, 55, 41, 0.08), 0 0.15rem 0.45rem rgba(33, 55, 41, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
}


.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    flex: 0 0 auto;
    margin-bottom: 1.15rem;
    border: 1px solid rgba(25, 135, 84, 0.16);
    border-radius: 999px;
    padding: 0.32rem;
    background: rgba(229, 239, 226, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border-radius: 999px;
    color: #31523a;
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.auth-tab:hover {
    color: var(--auth-green-dark);
    background: rgba(255, 255, 255, 0.44);
}

.auth-tab.is-active {
    background: linear-gradient(135deg, #198754 0%, #2f9f62 100%);
    color: #ffffff;
    box-shadow: 0 0.55rem 1rem rgba(25, 135, 84, 0.22);
}

.auth-tab.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-panel-heading {
    flex: 0 0 auto;
    margin-bottom: 1.05rem;
    text-align: left;
}

.auth-panel-heading h1 {
    margin: 0 0 0.45rem;
    color: #15251d;
    font-size: clamp(1.55rem, 2vw, 2rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.auth-panel-heading h1:last-child {
    margin-bottom: 0;
}

.auth-panel-heading p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-panel-eyebrow {
    margin-bottom: 0.45rem !important;
    color: var(--auth-green-dark) !important;
    font-size: 0.78rem !important;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Cartão clássico usado por ecrãs auth secundários */
.auth-card {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid rgba(16, 24, 40, 0.06);
    border-radius: 1rem;
    box-shadow: 0 0.75rem 1.8rem rgba(16, 24, 40, 0.08);
}

.auth-card-wide {
    max-width: 460px;
}

/* Cabeçalho clássico */
.auth-card-header,
.auth-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-brand {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--auth-green);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-card-header h1,
.auth-header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
    line-height: 1.2;
    font-weight: 700;
    color: #1f2933;
}

.auth-card-header p,
.auth-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Formulários */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 0;
}

.form-group,
.auth-field {
    margin-bottom: 1rem;
}

.auth-form .form-group,
.auth-form .auth-field {
    margin-bottom: 0;
}

.auth-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.auth-field-label {
    display: block;
    margin-bottom: 0.38rem;
}

.auth-input-shell {
    display: flex;
    align-items: stretch;
    min-height: 48px;
    border: 1px solid rgba(93, 106, 98, 0.22);
    border-radius: 0.68rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.03);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input-shell:focus-within {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.12), inset 0 1px 2px rgba(16, 24, 40, 0.03);
    background: #ffffff;
}

.auth-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    min-width: 3rem;
    border-right: 1px solid rgba(93, 106, 98, 0.15);
    border-radius: 0.68rem 0 0 0.68rem;
    background: linear-gradient(180deg, rgba(246, 250, 245, 0.98), rgba(238, 245, 237, 0.98));
    color: #26362b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    pointer-events: none;
}

.auth-input-icon svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
}

.auth-input-shell .form-control,
.auth-input-shell input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.68rem 0.82rem;
}

.auth-input-shell .form-control:focus,
.auth-input-shell input:focus {
    box-shadow: none;
}

.form-group label,
.auth-field label {
    display: block;
    margin-bottom: 0.32rem;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 700;
}

.form-control,
.auth-field input {
    display: block;
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(93, 106, 98, 0.22);
    border-radius: 0.78rem;
    padding: 0.68rem 0.82rem;
    background: rgba(255, 255, 255, 0.94);
    color: #101828;
    font: inherit;
    box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-control:focus,
.auth-field input:focus {
    outline: none;
    border-color: var(--auth-green);
    box-shadow: 0 0 0 0.22rem rgba(25, 135, 84, 0.14);
}

.form-control:disabled,
.auth-field input:disabled {
    background: #f1f3f2;
    color: #7a837e;
    cursor: not-allowed;
}

.auth-input-shell .form-control,
.auth-input-shell input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 46px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0.68rem 0.82rem;
}

.auth-input-shell .form-control:focus,
.auth-input-shell input:focus {
    border-color: transparent;
    box-shadow: none;
}

/* Botões */
.btn,
.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 0.78rem;
    padding: 0.75rem 1rem;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn-block,
.auth-button {
    width: 100%;
}

.btn-primary,
.auth-button {
    background: linear-gradient(135deg, #198754 0%, #279b61 100%);
    border-color: #198754;
    color: #ffffff;
    box-shadow: 0 0.75rem 1.25rem rgba(25, 135, 84, 0.18);
}

.auth-button-icon {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.5rem;
}

.auth-button-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.btn-primary:hover:not(:disabled),
.auth-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #157347 0%, #228b55 100%);
    border-color: #146c43;
    transform: translateY(-1px);
}

.btn:disabled,
.auth-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--auth-green);
    box-shadow: none;
}

.btn-link:hover:not(:disabled) {
    background: transparent;
    border-color: transparent;
    color: #146c43;
    text-decoration: underline;
}

/* Alertas */
.alert,
.auth-alert {
    margin-bottom: 1rem;
    border-radius: 0.8rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.alert-success,
.auth-alert-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

.alert-danger,
.auth-alert-danger {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.alert-warning,
.auth-alert-warning {
    background: #fffaeb;
    color: #b54708;
    border: 1px solid #fedf89;
}

.auth-card .alert-warning,
.auth-form-card .alert-warning {
    text-align: center;
    font-weight: 400;
}

.auth-flash-message {
    max-height: 12rem;
    overflow: hidden;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        max-height 0.24s ease,
        margin 0.24s ease,
        padding 0.24s ease,
        border-width 0.24s ease;
}

.auth-flash-message.is-dismissing {
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transform: translateY(-0.25rem);
}

/* Regras de password */
.auth-rules {
    border: 1px solid #e4e7ec;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    background: #f9fafb;
    color: #475467;
    font-size: 0.88rem;
}

.auth-rules strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #344054;
}

.auth-rules ul {
    margin: 0;
    padding-left: 1.2rem;
}

.auth-rules li + li {
    margin-top: 0.2rem;
}

/* Links */
.auth-links,
.auth-footer-link {
    flex: 0 0 auto;
    margin-top: 1rem;
    padding-top: 0.25rem;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.6;
}

.auth-card-footer {
    position: relative;
    flex: 0 0 auto;
    min-height: 2.35rem;
    margin-top: 1rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.auth-card-footer .auth-footer-link {
    width: 100%;
    margin-top: 0;
    padding: 0;
}

.auth-footer-prompt {
    display: block;
    margin-bottom: 0.12rem;
}

.auth-footer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}


.auth-links a,
.auth-footer-link a {
    color: var(--auth-green);
    font-weight: 700;
    text-decoration: none;
}

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

.auth-link-disabled {
    color: var(--auth-muted);
    font-weight: 500;
}

.auth-recovery-link-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.1rem;
}

.auth-recovery-link {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 2.2rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid rgba(18, 106, 78, 0.2);
    border-radius: 999px;
    background: rgba(18, 106, 78, 0.06);
    color: var(--auth-green);
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.auth-recovery-link:hover {
    border-color: rgba(18, 106, 78, 0.34);
    background: rgba(18, 106, 78, 0.11);
    box-shadow: 0 0.28rem 0.7rem rgba(18, 106, 78, 0.1);
    transform: translateY(-1px);
}

.auth-recovery-link:focus-visible {
    outline: 3px solid rgba(18, 106, 78, 0.2);
    outline-offset: 2px;
}

.auth-recovery-link-icon {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
}

.auth-recovery-link-icon svg {
    width: 100%;
    height: 100%;
}

.auth-recovery-link-arrow {
    margin-left: 0.05rem;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.18s ease;
}

.auth-recovery-link:hover .auth-recovery-link-arrow {
    transform: translateX(0.15rem);
}

.auth-secondary-action {
    margin-top: 0.75rem;
}

.auth-inline-help {
    margin-top: -0.25rem;
    margin-bottom: 0.05rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
}

.auth-two-factor-intro {
    margin-bottom: 1rem;
}

.auth-link-prefix {
    margin-right: 0.15rem;
}

.auth-links-login {
    margin-top: auto;
    padding-top: 0.85rem;
}

.text-muted {
    color: #6c757d;
}

.auth-link-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.auth-link-row + .auth-link-row {
    margin-top: 0.25rem;
}

.auth-link-separator {
    display: inline-block;
    margin: 0 0.45rem;
    color: #98a2b3;
}

.username-generator-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.username-generator-row .auth-input-shell {
    flex: 1 1 auto;
    min-width: 0;
}

.username-generator-row input {
    min-width: 0;
}

.username-regenerate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 6.5rem;
    min-height: 48px;
    border: 1px solid rgba(93, 106, 98, 0.22);
    border-radius: 0.62rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 248, 0.98));
    color: #344054;
    font-weight: 800;
    gap: 0.45rem;
    padding: 0 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

.username-regenerate-button:hover,
.username-regenerate-button:focus {
    border-color: var(--auth-green);
    color: var(--auth-green);
    outline: none;
}

.username-regenerate-button[disabled] {
    cursor: wait;
    opacity: 0.65;
}

.username-regenerate-icon {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
}

.username-regenerate-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-field-help {
    display: block;
    margin-top: 0.35rem;
    color: var(--auth-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.auth-form-section {
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0.9rem;
    padding: 0.78rem;
    background: rgba(247, 250, 248, 0.72);
}

.auth-form-section > legend {
    width: auto;
    margin: 0 0 0.7rem;
    padding: 0;
    color: #24352b;
    font-size: 0.9rem;
    font-weight: 850;
    letter-spacing: 0.02em;
}

.auth-form-section > .auth-field + .auth-field,
.auth-form-section > .auth-field-grid + .auth-field,
.auth-form-section > .auth-field + .auth-field-grid,
.auth-form-section > .auth-field-grid + .auth-field-grid {
    margin-top: 0.72rem;
}

.auth-field-optional {
    margin-left: 0.28rem;
    color: var(--auth-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.auth-birth-date-grid {
    display: grid;
    grid-template-columns: minmax(5.2rem, 0.7fr) minmax(8rem, 1.35fr) minmax(6.5rem, 0.85fr);
    gap: 0.55rem;
}

.auth-select-field {
    display: block;
    margin: 0;
}

.auth-select-field > span {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--auth-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-select-field select {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(93, 106, 98, 0.22);
    border-radius: 0.62rem;
    padding: 0.55rem 2rem 0.55rem 0.68rem;
    background: rgba(255, 255, 255, 0.96);
    color: #1f2933;
}

.auth-select-field select:focus {
    border-color: var(--auth-green);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.12);
}

.auth-age-notice {
    margin-top: 0.55rem;
    border: 1px solid rgba(199, 133, 19, 0.25);
    border-radius: 0.7rem;
    padding: 0.58rem 0.68rem;
    background: rgba(255, 247, 224, 0.82);
    color: #6b4b12;
    font-size: 0.82rem;
    line-height: 1.42;
}

.auth-legal-section {
    display: grid;
    gap: 0.62rem;
}

.auth-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 0.62rem;
    margin: 0;
    border: 1px solid rgba(93, 106, 98, 0.15);
    border-radius: 0.72rem;
    padding: 0.68rem;
    background: rgba(255, 255, 255, 0.9);
    color: #344054;
    font-size: 0.84rem;
    line-height: 1.45;
    cursor: pointer;
}

.auth-consent-row input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.12rem;
    accent-color: var(--auth-green);
}

.auth-consent-row a {
    color: var(--auth-green);
    font-weight: 750;
}

.auth-consent-row a:hover,
.auth-consent-row a:focus {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .auth-birth-date-grid {
        grid-template-columns: 1fr;
    }
}

/* Manutenção */
.maintenance-notice {
    width: 100%;
    padding: 10px 16px;
    background: #fff3cd;
    color: #664d03;
    border-bottom: 1px solid #ffecb5;
    text-align: center;
    font-weight: 600;
    position: fixed;
    top: 0;
    left: 0;
}


/* Composição uniforme dos cartões principais de autenticação */
.auth-form-card .auth-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.35rem;
    padding-bottom: 0.45rem;
    margin-right: -0.2rem;
    gap: 0.7rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(25, 135, 84, 0.35) rgba(25, 135, 84, 0.08);
}

.auth-form-card .auth-form::-webkit-scrollbar {
    width: 0.45rem;
}

.auth-form-card .auth-form::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(25, 135, 84, 0.08);
}

.auth-form-card .auth-form::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(25, 135, 84, 0.32);
}

.auth-form-card .auth-field-grid {
    gap: 0.65rem;
}

.auth-form-card .form-group,
.auth-form-card .auth-field {
    margin-bottom: 0;
}

.auth-form-card .form-control,
.auth-form-card .auth-field input {
    min-height: 40px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.auth-form-card .username-regenerate-button {
    min-height: 40px;
}

.auth-form-card .auth-button {
    flex: 0 0 auto;
    min-height: 44px;
    margin-top: auto;
}

.auth-form-card .auth-panel-heading,
.auth-form-card .auth-tabs,
.auth-form-card .auth-links,
.auth-form-card .auth-footer-link,
.auth-form-card .alert,
.auth-form-card .auth-alert {
    flex-shrink: 0;
}

.auth-form-card .auth-panel-heading p {
    max-width: 22rem;
}

.auth-form-card .auth-rules {
    padding: 0.62rem 0.78rem;
    font-size: 0.8rem;
    line-height: 1.35;
}

.auth-form-card .auth-rules strong {
    margin-bottom: 0.28rem;
}

.auth-form-card .auth-rules ul {
    padding-left: 1rem;
}

.auth-form-card .auth-rules li + li {
    margin-top: 0.06rem;
}

/* Responsivo */
@media (max-height: 760px) and (min-width: 981px) {
    .auth-form-card {
        height: 100%;
    }
    .auth-wrapper,
    .auth-page {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        place-items: center;
    }

    .auth-experience,
    .auth-experience-register {
        height: clamp(var(--auth-experience-min-height), calc(100vh - 4rem), var(--auth-experience-max-height));
        height: clamp(var(--auth-experience-min-height), calc(100svh - 4rem), var(--auth-experience-max-height));
    }

    .auth-form-card {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .auth-form-card .auth-tabs {
        margin-bottom: 0.85rem;
    }

    .auth-form-card .auth-panel-heading {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 980px) {
    .auth-experience,
    .auth-experience-register {
        height: auto;
        min-height: 0;
        max-height: none;
        grid-template-columns: 1fr;
    }

    .auth-visual-panel {
        min-height: 420px;
        background-position: center 46%;
    }

    .auth-visual-panel::after {
        background: linear-gradient(180deg, rgba(255, 247, 232, 0) 0%, rgba(255, 247, 232, 0.2) 58%, var(--auth-paper) 100%);
    }

    .auth-visual-content {
        width: min(58%, 420px);
        padding: 1.4rem 1.5rem 4rem;
    }

    .auth-visual-logo-link {
        margin-bottom: 0.9rem;
    }

    .auth-visual-logo {
        width: 185px;
    }

    .auth-visual-copy,
    .auth-experience-login .auth-visual-copy,
    .auth-experience-register .auth-visual-copy {
        position: static;
        left: auto;
        bottom: auto;
        max-width: min(20rem, 100%);
        margin-top: 0;
    }

    .auth-visual-title {
        font-size: clamp(1.9rem, 5.4vw, 2.8rem);
    }

    .auth-visual-subtitle {
        max-width: 18rem;
    }

    .auth-visual-mascot {
        left: auto;
        right: clamp(1.25rem, 3.2vw, 2rem);
        bottom: -0.65rem;
        width: min(40%, 250px);
        height: auto;
        max-height: 88%;
    }

    .auth-form-panel {
        background: linear-gradient(180deg, var(--auth-panel-bg) 0%, var(--auth-form-bg) 100%);
    }

    .auth-form-panel::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .auth-wrapper,
    .auth-page {
        padding: 0;
        place-items: stretch;
    }

    .auth-experience,
    .auth-card {
        border-radius: 0;
    }

    .auth-experience {
        width: 100%;
        border-width: 0;
        box-shadow: none;
    }

    .auth-visual-panel {
        min-height: 350px;
        background-position: center 48%;
    }

    .auth-visual-content {
        width: 62%;
        padding: 1.15rem 0.9rem 3.6rem 1.15rem;
    }

    .auth-visual-logo-link {
        margin-bottom: 0.65rem;
    }

    .auth-visual-logo {
        width: 158px;
    }

    .auth-visual-kicker {
        font-size: 0.68rem;
    }

    .auth-visual-copy,
    .auth-experience-login .auth-visual-copy,
    .auth-experience-register .auth-visual-copy {
        position: static;
        left: auto;
        bottom: auto;
        max-width: 13rem;
        margin-top: 0;
    }

    .auth-visual-title {
        font-size: clamp(1.55rem, 8vw, 2.1rem);
        line-height: 0.98;
        letter-spacing: -0.045em;
    }

    .auth-visual-subtitle {
        display: none;
    }

    .auth-visual-mascot {
        width: min(48%, 210px);
        right: clamp(1.25rem, 5vw, 1.75rem);
        bottom: -0.8rem;
        max-height: 88%;
    }

    .auth-form-panel {
        padding: 1rem;
    }

    .auth-form-card {
        width: 100%;
        min-height: 0;
        border-radius: 1.05rem;
        padding: 1.1rem;
    }

    .auth-field-grid {
        grid-template-columns: 1fr;
    }


    .auth-panel-heading h1 {
        font-size: 1.45rem;
    }
}

@media (max-width: 640px) {
    .auth-card-footer {
        display: block;
    }

    .auth-card-footer .auth-footer-link {
        width: 100%;
        padding: 0;
        text-align: center;
    }

    .auth-footer-actions {
        gap: 0.4rem;
    }

    .auth-visual-cookie-settings {
        left: 1rem;
        bottom: 0.75rem;
        min-height: 2rem;
        padding: 0.34rem 0.58rem;
        font-size: 0.74rem;
    }
}

@media (max-width: 420px) {
    .auth-visual-panel {
        min-height: 325px;
    }

    .auth-visual-content {
        width: 64%;
        padding-left: 1rem;
    }

    .auth-visual-logo {
        width: 148px;
    }

    .auth-visual-title {
        font-size: clamp(1.5rem, 7.7vw, 1.95rem);
        letter-spacing: -0.035em;
    }

    .auth-visual-mascot {
        width: min(48%, 180px);
        right: 1.1rem;
        bottom: -0.6rem;
        opacity: 0.96;
    }

    .auth-tabs {
        border-radius: 1rem;
    }

    .auth-tab {
        min-height: 2.35rem;
        font-size: 0.86rem;
    }
}

/* Recuperação segura de password */
.auth-password-reset-form.is-token-pending [data-password-reset-control],
.auth-password-reset-form.is-token-missing [data-password-reset-control] {
    pointer-events: none;
}

.auth-reset-token-status {
    margin-bottom: 0;
}

.auth-validation-list {
    margin: 0.45rem 0 0;
    padding-left: 1.15rem;
}

.auth-validation-list li + li {
    margin-top: 0.2rem;
}

.auth-button-link {
    flex: 0 0 auto;
    margin-top: auto;
}
