/* ============================================
   Auth pages (login, cadastro, recuperar-senha)
   Usa tokens de design/brand v2: navy + orange.
   ============================================ */

/* Page shell */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-4);
    background:
        radial-gradient(circle at 15% 0%, rgba(0, 11, 39, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 100%, rgba(253, 136, 1, 0.06) 0%, transparent 50%),
        var(--color-bg);
    font-family: var(--font-body);
    color: var(--color-text);
}

.auth-page {
    display: flex;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: var(--color-bg-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
}
.auth-page--narrow { max-width: 860px; min-height: 500px; }

/* Sidebar (brand panel) */
.auth-sidebar {
    display: none;
    width: 380px;
    flex-shrink: 0;
    background:
        linear-gradient(135deg,
            var(--color-primary-dark) 0%,
            var(--color-primary) 55%,
            rgba(253, 136, 1, 0.45) 100%);
    color: var(--color-text-inverse);
    padding: var(--space-10) var(--space-8);
    position: relative;
    overflow: hidden;
}
.auth-page--narrow .auth-sidebar { width: 360px; }
.auth-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(253, 136, 1, 0.18) 0%, transparent 55%);
    pointer-events: none;
}
.auth-sidebar > * { position: relative; }
@media (min-width: 768px) {
    .auth-sidebar { display: flex; flex-direction: column; justify-content: center; }
}

.auth-sidebar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
    color: var(--color-text-inverse);
    text-decoration: none;
}
.auth-sidebar__logo img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.auth-sidebar__logo span {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.auth-sidebar__title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
    line-height: var(--leading-tight);
    color: var(--color-text-inverse);
}
.auth-sidebar__title strong {
    color: var(--color-cta);
    font-weight: var(--font-bold);
}
.auth-sidebar__text {
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.85);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-6);
}

/* Sidebar — stats */
.auth-sidebar__stats {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(255,255,255,0.15);
}
.auth-sidebar__stat { flex: 1; min-width: 0; }
.auth-sidebar__stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-cta);
    line-height: 1;
    margin-bottom: var(--space-1);
}
.auth-sidebar__stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

/* Sidebar — numbered steps (forgot-password) */
.auth-sidebar__steps {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-sidebar__steps li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.9);
    line-height: var(--leading-normal);
}
.auth-sidebar__steps li:last-child { margin-bottom: 0; }
.auth-sidebar__steps li strong {
    color: var(--color-text-inverse);
    font-weight: var(--font-semibold);
}
.auth-sidebar__step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-cta);
    color: var(--color-text-inverse);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    flex-shrink: 0;
    margin-top: -2px;
    box-shadow: 0 2px 8px rgba(253, 136, 1, 0.35);
}

/* Sidebar — features list (cadastro) */
.auth-sidebar__features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.auth-sidebar__features li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
    color: rgba(255,255,255,0.9);
    line-height: var(--leading-normal);
}
.auth-sidebar__features li svg {
    flex-shrink: 0;
    color: var(--color-cta);
    margin-top: 2px;
}

/* Sidebar — trust bar at bottom */
.auth-sidebar__trust {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.7);
}
.auth-sidebar__trust svg { color: var(--color-cta); flex-shrink: 0; }

/* Main column (form area) */
.auth-main {
    flex: 1;
    padding: var(--space-8) var(--space-6);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (min-width: 768px) {
    .auth-main { padding: var(--space-10) var(--space-10); }
}

.auth-header { margin-bottom: var(--space-6); }
.auth-header__mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    text-decoration: none;
    color: var(--color-text);
}
.auth-header__mobile-logo img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
.auth-header__mobile-logo span {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
}
@media (min-width: 768px) {
    .auth-header__mobile-logo { display: none; }
}

.auth-header__title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text);
    margin-bottom: var(--space-1);
    line-height: var(--leading-tight);
}
.auth-header__subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
}

/* Alerts */
.auth-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    line-height: var(--leading-normal);
}
.auth-alert--success {
    background: var(--color-success-light);
    color: #064E45;
    border: 1px solid #A7E8DE;
}
.auth-alert--error {
    background: var(--color-error-light);
    color: #911818;
    border: 1px solid #F5A8A8;
}
.auth-alert svg { flex-shrink: 0; margin-top: 1px; }

/* Social auth buttons */
.auth-social {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}
.auth-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    background: var(--color-bg-white);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    line-height: 1;
}
.auth-social__btn:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.auth-social__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.auth-social__btn--facebook {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
}
.auth-social__btn--facebook:hover { border-color: #166fe5; background: #166fe5; }
.auth-social__btn svg { flex-shrink: 0; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* Form fields */
.auth-form .form-group { margin-bottom: var(--space-4); }
.auth-form .form-group:last-of-type { margin-bottom: 0; }
.auth-form .form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}
.auth-form .form-label .optional {
    font-weight: var(--font-regular);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    margin-left: var(--space-1);
}
.auth-form .form-input,
.auth-form .form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
    font-size: var(--text-base);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    font-family: var(--font-body);
}
.auth-form .form-input:focus,
.auth-form .form-select:focus {
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 11, 39, 0.12);
    outline: none;
}
.auth-form .form-input.error,
.auth-form .form-select.error {
    border-color: var(--color-error);
}
.auth-form .form-input.error:focus,
.auth-form .form-select.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.auth-form .form-error {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-error);
    margin-top: var(--space-1);
}

.auth-form__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
@media (min-width: 480px) {
    .auth-form__row--2 { grid-template-columns: 1fr 1fr; }
    .auth-form__row--city { grid-template-columns: 1fr 100px; }
}

/* Password input with toggle */
.password-wrapper { position: relative; }
.password-wrapper .form-input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: var(--space-1);
    display: inline-flex;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.password-toggle:hover {
    color: var(--color-text);
    background: var(--color-bg-hover);
}
.password-toggle:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 1px;
}

/* Password strength + checklist */
.password-strength {
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    margin-top: var(--space-2);
    overflow: hidden;
}
.password-strength__bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow), background-color var(--transition-slow);
    width: 0;
}
.password-checklist {
    list-style: none;
    margin: var(--space-2) 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
}
.password-checklist li {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.3;
    transition: color var(--transition-fast);
}
.password-checklist li::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border-hover);
    flex-shrink: 0;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.password-checklist li.ok {
    color: var(--color-success);
    font-weight: var(--font-medium);
}
.password-checklist li.ok::before {
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / 10px no-repeat,
        var(--color-success);
    border-color: var(--color-success);
}

/* Login options row */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}
.auth-options__check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
}
.auth-options__check input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}
.auth-options__forgot {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    text-decoration: none;
}
.auth-options__forgot:hover { text-decoration: underline; }

/* CTA submit button */
.auth-form__submit {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: var(--color-cta);
    color: var(--color-text-inverse);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: background-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    line-height: 1.2;
}
.auth-form__submit:hover {
    background: var(--color-cta-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.auth-form__submit:active { transform: translateY(0); }
.auth-form__submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary variant (used for "Enviar novamente" no success state) */
.auth-form__submit--ghost {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    text-decoration: none;
    max-width: 280px;
    margin: 0 auto;
}
.auth-form__submit--ghost:hover {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-md);
}

/* Success state (forgot-password) */
.auth-success {
    text-align: center;
    padding: var(--space-2) 0;
}
.auth-success__icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-success-light);
    color: var(--color-success);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-5);
}
.auth-success__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
    line-height: var(--leading-tight);
}
.auth-success__text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.auth-success__tips {
    text-align: left;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
}
.auth-success__tips strong {
    display: block;
    color: var(--color-text);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}
.auth-success__tips ul {
    list-style: disc;
    padding-left: var(--space-5);
    margin: 0;
}
.auth-success__tips li { margin-bottom: var(--space-1); }
.auth-success__tips li:last-child { margin-bottom: 0; }
.auth-success__tips li strong {
    display: inline;
    color: var(--color-text);
    font-size: inherit;
    margin: 0;
}

/* Spin animation (loading state on submit) */
@keyframes auth-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: auth-spin 1s linear infinite; }

/* Acceptance / consent block */
.auth-consent {
    margin-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.auth-consent__item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: var(--leading-normal);
}
.auth-consent__item input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}
.auth-consent__item a {
    color: var(--color-primary);
    font-weight: var(--font-semibold);
    text-decoration: underline;
}
.auth-consent__item a:hover { color: var(--color-primary-hover); }

/* Footer link */
.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}
.auth-footer a {
    color: var(--color-primary);
    font-weight: var(--font-semibold);
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

/* Trust badges row (below form) */
.auth-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}
.auth-trust__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1;
}
.auth-trust__badge svg {
    color: var(--color-success);
    flex-shrink: 0;
}

/* Mobile tweaks */
@media (max-width: 767px) {
    .auth-body { padding: var(--space-2); }
    .auth-page { min-height: 0; border-radius: var(--radius-xl); }
    .auth-main { padding: var(--space-6) var(--space-4); }
    .auth-header { margin-bottom: var(--space-5); }
    .auth-header__title { font-size: var(--text-xl); }
    .password-checklist { grid-template-columns: 1fr; }
    .auth-trust { gap: var(--space-3); }
}
