:root {
    --webcrv-primary: #2463d4;
    --webcrv-primary-dark: #17499f;
    --webcrv-primary-soft: #eaf1ff;
    --webcrv-dark: #0b1f35;
    --webcrv-text: #1c2c3e;
    --webcrv-muted: #617186;
    --webcrv-border: #dbe3ed;
    --webcrv-light: #f5f8fc;
    --webcrv-surface: #ffffff;
    --webcrv-success: #18785f;
    --webcrv-danger: #b42318;
    --webcrv-shadow: rgba(11, 31, 53, 0.1);
    --webcrv-focus: rgba(36, 99, 212, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--webcrv-text);
    background: var(--webcrv-light);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--webcrv-primary);
}

a:hover {
    color: var(--webcrv-primary-dark);
}

:focus-visible {
    outline: 3px solid var(--webcrv-focus);
    outline-offset: 3px;
}

.auth-body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.auth-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--webcrv-dark);
    border-radius: 6px;
    transform: translateY(-160%);
}

.auth-skip-link:focus {
    color: #ffffff;
    transform: translateY(0);
}

.auth-header {
    background: var(--webcrv-surface);
    border-bottom: 1px solid var(--webcrv-border);
}

.auth-header-inner {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.auth-brand,
.auth-brand img {
    display: block;
}

.auth-brand img {
    width: 164px;
    height: 45px;
    object-fit: contain;
}

.auth-home-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    color: var(--webcrv-text);
    font-size: 0.94rem;
    font-weight: 650;
    text-decoration: none;
}

.auth-main {
    display: flex;
    flex: 1;
    align-items: center;
    padding: 44px 0;
}

.auth-shell {
    width: min(100%, 560px);
    margin: 0 auto;
}

.auth-shell-wide {
    width: min(100%, 650px);
}

.auth-card {
    padding: 34px;
    background: var(--webcrv-surface);
    border: 1px solid var(--webcrv-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px var(--webcrv-shadow);
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading h1 {
    margin: 0;
    color: var(--webcrv-dark);
    font-size: 1.75rem;
    font-weight: 750;
    line-height: 1.25;
}

.auth-heading p {
    margin: 10px 0 0;
    color: var(--webcrv-muted);
    line-height: 1.6;
}

.form-label {
    color: var(--webcrv-dark);
    font-size: 0.92rem;
    font-weight: 650;
}

.form-control {
    min-height: 46px;
    color: var(--webcrv-text);
    border-color: #cbd6e2;
    border-radius: 6px;
}

.form-control:focus {
    border-color: var(--webcrv-primary);
    box-shadow: 0 0 0 3px var(--webcrv-focus);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.password-toggle {
    display: inline-flex;
    width: 46px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    color: var(--webcrv-muted);
    background: var(--webcrv-surface);
    border-color: #cbd6e2;
    border-radius: 0 6px 6px 0;
}

.password-toggle:hover,
.password-toggle:focus,
.password-toggle:active {
    color: var(--webcrv-primary-dark);
    background: var(--webcrv-primary-soft);
    border-color: var(--webcrv-primary);
}

.password-toggle:focus {
    box-shadow: 0 0 0 3px var(--webcrv-focus);
}

.invalid-feedback {
    color: var(--webcrv-danger);
}

.auth-card .alert {
    border-radius: 6px;
    line-height: 1.5;
}

.auth-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: #edf2f7;
    border: 1px solid var(--webcrv-border);
    border-radius: 7px;
}

.auth-mode-option {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    color: var(--webcrv-muted);
    border-radius: 5px;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.auth-mode-option:hover {
    color: var(--webcrv-dark);
}

.auth-mode-option.is-active {
    color: var(--webcrv-primary-dark);
    background: var(--webcrv-surface);
    box-shadow: 0 1px 3px rgba(11, 31, 53, 0.12);
}

.auth-inline-link {
    margin-bottom: 0.5rem;
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
}

.auth-help-text {
    margin: 14px 0 0;
    color: var(--webcrv-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.auth-submit,
.auth-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 6px;
    font-weight: 700;
}

/* Mantem icones e rotulos separados mesmo quando o HTML nao contem espaco. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.btn-primary {
    --bs-btn-bg: var(--webcrv-primary);
    --bs-btn-border-color: var(--webcrv-primary);
    --bs-btn-hover-bg: var(--webcrv-primary-dark);
    --bs-btn-hover-border-color: var(--webcrv-primary-dark);
    --bs-btn-active-bg: var(--webcrv-primary-dark);
    --bs-btn-active-border-color: var(--webcrv-primary-dark);
}

.auth-secondary {
    margin: 24px 0 0;
    color: var(--webcrv-muted);
    text-align: center;
}

.auth-secondary a {
    font-weight: 700;
}

.auth-note {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    color: var(--webcrv-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-note i {
    flex: 0 0 auto;
    color: var(--webcrv-success);
}

.status-icon {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    color: var(--webcrv-primary);
    background: var(--webcrv-primary-soft);
    border-radius: 8px;
    font-size: 1.5rem;
}

.status-icon-success {
    color: var(--webcrv-success);
    background: #e6f5ef;
}

.status-icon-warning {
    color: #a56812;
    background: #fff4df;
}

.status-email {
    overflow-wrap: anywhere;
    color: var(--webcrv-dark);
    font-weight: 700;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.auth-footer {
    padding: 20px 0;
    color: var(--webcrv-muted);
    font-size: 0.86rem;
    text-align: center;
}

@media (max-width: 575.98px) {
    .auth-header-inner {
        min-height: 64px;
    }

    .auth-brand img {
        width: 138px;
        height: 38px;
    }

    .auth-home-link span {
        display: none;
    }

    .auth-home-link {
        width: 44px;
        justify-content: center;
        font-size: 1.15rem;
    }

    .auth-main {
        align-items: flex-start;
        padding: 24px 0;
    }

    .auth-card {
        padding: 24px 20px;
    }

    .auth-heading {
        margin-bottom: 24px;
    }

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

    .status-actions .btn {
        width: 100%;
    }

    .auth-mode-option {
        font-size: 0.84rem;
    }
}

@media (max-width: 349.98px) {
    .recaptcha-frame {
        width: 250px;
        height: 64px;
        overflow: hidden;
    }

    .recaptcha-wrap {
        width: 304px;
        transform: scale(0.82);
        transform-origin: left top;
    }
}
