/*
 * Me Indica Alguém? v3.0 — Premium Auth CSS
 * Multi-step wizard with separated data sections
 * Ultra-responsive: mobile-first with fluid design
 */

/* ═══ Page Background ═══ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    padding: clamp(1rem, 3vw, 2.5rem) clamp(0.75rem, 2vw, 1.5rem);
    position: relative;
    overflow: hidden;
    background: var(--bg-color);
    z-index: 1;
}

.auth-page::before, .auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    animation: authFloat 12s infinite ease-in-out alternate;
    pointer-events: none;
}
.auth-page::before {
    width: 45vw; height: 45vw;
    background: radial-gradient(circle, rgba(15,76,129,0.12), transparent 70%);
    top: -15vw; left: -10vw;
}
.auth-page::after {
    width: 35vw; height: 35vw;
    background: radial-gradient(circle, rgba(66,153,225,0.08), transparent 70%);
    bottom: -8vw; right: -8vw;
    animation-delay: -6s;
}
html.dark .auth-page::before { background: radial-gradient(circle, rgba(66,153,225,0.15), transparent 70%); }
html.dark .auth-page::after { background: radial-gradient(circle, rgba(99,179,237,0.08), transparent 70%); }

@keyframes authFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(25px, 20px) scale(1.05); }
}

/* ═══ Main Container ═══ */
.auth-container {
    width: 100%;
    max-width: 620px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: clamp(16px, 3vw, 28px);
    box-shadow:
        0 24px 64px rgba(15,76,129,0.07),
        0 4px 12px rgba(0,0,0,0.03),
        inset 0 1px 0 rgba(255,255,255,0.6);
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 3.5vw, 2.5rem);
    position: relative;
    z-index: 2;
}
html.dark .auth-container {
    background: rgba(18,24,38,0.82);
    border-color: rgba(255,255,255,0.06);
    box-shadow: 0 24px 64px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.03);
}

/* ═══ Tabs (Pill Style) ═══ */
.auth-tabs {
    display: flex;
    position: relative;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    background: var(--gray-100);
    border-radius: 14px;
    padding: 4px;
}
html.dark .auth-tabs { background: rgba(0,0,0,0.35); }

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.85rem 0;
    font-size: clamp(0.88rem, 2vw, 1rem);
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    position: relative;
    z-index: 2;
    border-radius: 11px;
    transition: color 0.3s ease;
    font-family: var(--font-body);
}
.auth-tab.active { color: var(--primary); }
html.dark .auth-tab.active { color: #fff; }

.tab-indicator {
    position: absolute;
    top: 4px; bottom: 4px; left: 4px;
    width: calc(50% - 4px);
    background: #fff;
    border-radius: 11px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.4s cubic-bezier(0.25,1,0.5,1);
    z-index: 1;
}
html.dark .tab-indicator { background: var(--primary); box-shadow: 0 2px 10px rgba(15,76,129,0.3); }

.auth-tab[data-target="register"].active ~ .tab-indicator,
.auth-tabs:has(.auth-tab[data-target="register"].active) .tab-indicator {
    transform: translateX(100%);
}

/* ═══ Alert ═══ */
.auth-alert { display: none; }

/* ═══ Panels ═══ */
.auth-panel { display: none; animation: authSlideUp 0.4s cubic-bezier(0.2,0.8,0.2,1) forwards; opacity: 0; }
.auth-panel.active { display: block; }
@keyframes authSlideUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.panel-header { text-align: center; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.panel-header h2 {
    font-size: clamp(1.3rem, 3.5vw, 1.65rem);
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.35rem;
    letter-spacing: -0.4px;
}
.panel-header p { font-size: clamp(0.85rem, 2vw, 0.95rem); color: var(--text-muted); }

/* ═══ Section Dividers ═══ */
.auth-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: clamp(1.5rem, 3vw, 2rem) 0 clamp(1rem, 2vw, 1.25rem);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}
html.dark .auth-section-title { border-color: rgba(255,255,255,0.08); }

.auth-section-title .section-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(15,76,129,0.1), rgba(15,76,129,0.02));
    border-radius: 10px;
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}
html.dark .auth-section-title .section-icon {
    background: linear-gradient(135deg, rgba(66,153,225,0.15), rgba(66,153,225,0.03));
    color: var(--primary-light);
}

.auth-section-title h3 {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.auth-section-title small {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 1px;
}

/* ═══ Form Controls ═══ */
.form-group { margin-bottom: clamp(0.9rem, 2vw, 1.2rem); position: relative; }
.form-row { display: flex; gap: clamp(0.6rem, 1.5vw, 1rem); }
.form-row .half { flex: 1; min-width: 0; }

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: clamp(0.78rem, 1.8vw, 0.85rem);
    font-weight: 600;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > i:first-child {
    position: absolute; left: clamp(0.9rem, 2vw, 1.15rem);
    color: var(--gray-400); font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none; z-index: 2;
}

.auth-form .form-control {
    width: 100%;
    padding: clamp(0.8rem, 2vw, 0.95rem) 1.15rem clamp(0.8rem, 2vw, 0.95rem) 2.8rem;
    background: var(--light);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: max(16px, clamp(0.88rem, 2vw, 1rem));
    color: var(--text-main);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.015);
}
html.dark .auth-form .form-control { background: rgba(0,0,0,0.2); border-color: rgba(255,255,255,0.08); }

.auth-form .form-control:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(15,76,129,0.1);
    outline: none;
}
html.dark .auth-form .form-control:focus { background: rgba(0,0,0,0.35); box-shadow: 0 0 0 4px rgba(15,76,129,0.25); }

.input-icon:focus-within > i:first-child { color: var(--primary); transform: scale(1.1); }
.form-group:focus-within .form-label { color: var(--primary); }

.toggle-password {
    position: absolute; right: 0.4rem; background: transparent; border: none;
    color: var(--gray-400); width: 42px; height: 100%; cursor: pointer;
    transition: color 0.2s ease; display: flex; align-items: center; justify-content: center;
}
.toggle-password:hover { color: var(--primary); }

/* Field Status & Hints */
.field-status { position: absolute; right: 1.15rem; font-weight: bold; opacity: 0; transition: opacity 0.3s ease; }
.field-status.valid { color: var(--success); opacity: 1; }
.field-status.valid::after { content: '✓'; }
.field-status.invalid { color: var(--danger); opacity: 1; }
.field-status.invalid::after { content: '✗'; }
.field-status.loading { color: var(--primary); opacity: 1; }
.field-status.loading::after { content: '⋯'; animation: fsPulse 1s infinite alternate; }
@keyframes fsPulse { from { opacity:0.5; } to { opacity:1; } }

.field-hint { display: block; font-size: 0.78rem; margin-top: 0.35rem; color: var(--text-muted); min-height: 14px; }
.field-hint.error { color: var(--danger); }
.field-hint.success { color: var(--success); }

/* ═══ Auth Buttons ═══ */
.auth-form .btn {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    width: 100%; padding: clamp(0.9rem, 2vw, 1.05rem); border-radius: 12px;
    font-weight: 700; font-size: clamp(0.95rem, 2vw, 1.05rem);
    cursor: pointer; transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1); border: none;
    font-family: var(--font-body);
}

.auth-form .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1562a3 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(15,76,129,0.25);
}
.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15,76,129,0.35);
}
.auth-form .btn-primary:active { transform: translateY(0); }

.auth-form .btn-outline {
    background: transparent; color: var(--primary); border: 2px solid var(--primary);
}
.auth-form .btn-outline:hover { background: rgba(15,76,129,0.05); }

/* Google Button */
.btn-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; box-shadow: 0 2px 6px rgba(0,0,0,0.02); }
.btn-google:hover { background: #f8f9fa; box-shadow: 0 4px 12px rgba(0,0,0,0.05); transform: translateY(-1px); }
html.dark .btn-google { background: rgba(255,255,255,0.05); color: #fff; border-color: rgba(255,255,255,0.1); }
html.dark .btn-google:hover { background: rgba(255,255,255,0.1); }

/* ═══ Divider ═══ */
.auth-divider { display: flex; align-items: center; margin: 1.5rem 0; color: var(--gray-400); font-size: 0.88rem; font-weight: 500; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
html.dark .auth-divider::before, html.dark .auth-divider::after { background: rgba(255,255,255,0.1); }
.auth-divider span { padding: 0 1rem; }

/* ═══ Form Options (login) ═══ */
.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.9rem; flex-wrap: wrap; gap: 0.5rem; }

.remember-me {
    display: flex; align-items: center; gap: 0.6rem; cursor: pointer;
    color: var(--text-muted); font-size: 0.9rem; user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.remember-me input { display: none; }
.remember-me .custom-check {
    width: 22px; height: 22px; min-width: 22px;
    border: 2px solid var(--gray-300, #c4cdd5);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    background: transparent;
    position: relative;
}
html.dark .remember-me .custom-check { border-color: rgba(255,255,255,0.2); }

.remember-me .custom-check i {
    font-size: 0.65rem; color: #fff; opacity: 0;
    transform: scale(0);
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.remember-me input:checked + .custom-check {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(15,76,129,0.3);
}
.remember-me input:checked + .custom-check i {
    opacity: 1; transform: scale(1);
}
.remember-me:hover .custom-check { border-color: var(--primary); }

.forgot-password { color: var(--primary); font-weight: 600; font-size: 0.88rem; }
.forgot-password:hover { text-decoration: underline; }

/* ═══ Wizard Progress ═══ */
.wizard-progress {
    position: relative;
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    padding: 0 5px;
}

.progress-bar {
    position: absolute;
    top: 17px; left: 35px; right: 35px;
    height: 3px;
    background: var(--gray-200);
    border-radius: 2px;
    z-index: 0;
}
html.dark .progress-bar { background: rgba(255,255,255,0.1); }

.progress-bar::after {
    content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--primary), #1562a3);
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.25,1,0.5,1);
    box-shadow: 0 0 8px rgba(15,76,129,0.4);
}
.progress-bar[data-progress="1"]::after { width: 0%; }
.progress-bar[data-progress="2"]::after { width: 25%; }
.progress-bar[data-progress="3"]::after { width: 50%; }
.progress-bar[data-progress="4"]::after { width: 75%; }
.progress-bar[data-progress="5"]::after { width: 100%; }

.progress-steps { display: flex; justify-content: space-between; position: relative; z-index: 1; }

.progress-step {
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    flex: 1;
}
.progress-step span {
    width: clamp(32px, 7vw, 38px); height: clamp(32px, 7vw, 38px);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem); font-weight: 700;
    background: var(--gray-200); color: var(--gray-800);
    transition: all 0.4s ease;
    border: 3px solid var(--light);
    opacity: 1;
}
html.dark .progress-step span { background: rgba(255,255,255,0.2); color: #cbd5e0; border-color: var(--dark); }

.progress-step small {
    font-size: clamp(0.6rem, 1.5vw, 0.75rem);
    color: var(--gray-800); font-weight: 600;
    transition: color 0.3s;
    text-align: center;
    line-height: 1.2;
}

.progress-step.active span {
    background: var(--primary); color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(15,76,129,0.15);
}
.progress-step.active small { color: var(--primary); }

.progress-step.done span {
    background: var(--primary); color: #fff; font-size: 0;
}
.progress-step.done span::after {
    content: '\f00c'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
}

/* ═══ Wizard Steps ═══ */
.wizard-step { display: none; animation: wsSlide 0.4s cubic-bezier(0.2,0.8,0.2,1) forwards; opacity: 0; }
.wizard-step.active { display: block; }
@keyframes wsSlide { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

/* ═══ Type Selection Cards ═══ */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.75rem, 2vw, 1rem); margin-bottom: 1.5rem; }
.type-card { cursor: pointer; position: relative; }
.type-card input { display: none; }

.type-card-inner {
    padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1rem, 2vw, 1.25rem);
    text-align: center;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    background: transparent;
    transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1);
    position: relative; overflow: hidden; height: 100%;
}
html.dark .type-card-inner { border-color: rgba(255,255,255,0.1); }

.type-icon {
    width: clamp(48px, 10vw, 56px); height: clamp(48px, 10vw, 56px);
    margin: 0 auto clamp(0.75rem, 2vw, 1rem);
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100); border-radius: 50%;
    font-size: clamp(1.2rem, 3vw, 1.5rem); color: var(--gray-500);
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
html.dark .type-icon { background: rgba(255,255,255,0.05); }

.type-card-inner h3 { font-size: clamp(0.95rem, 2.2vw, 1.05rem); margin-bottom: 0.4rem; color: var(--text-main); font-weight: 700; }
.type-card-inner p { font-size: clamp(0.75rem, 1.8vw, 0.82rem); color: var(--text-muted); line-height: 1.45; margin: 0; }

.type-card:hover .type-card-inner { border-color: rgba(15,76,129,0.3); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15,76,129,0.08); }
.type-card:hover .type-icon { transform: scale(1.08); color: var(--primary); }

.type-card input:checked + .type-card-inner {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(15,76,129,0.05), rgba(15,76,129,0.01));
    box-shadow: 0 6px 20px rgba(15,76,129,0.12);
}
html.dark .type-card input:checked + .type-card-inner { background: rgba(15,76,129,0.15); }

.type-card input:checked + .type-card-inner .type-icon {
    background: var(--primary); color: #fff; transform: scale(1.08);
    box-shadow: 0 6px 12px rgba(15,76,129,0.3);
}
.type-card input:checked + .type-card-inner::after {
    content: '\f058'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
    position: absolute; top: 12px; right: 12px; color: var(--primary); font-size: 1.2rem;
    animation: tcPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes tcPop { from { transform:scale(0); opacity:0; } to { transform:scale(1); opacity:1; } }

/* ═══ Wizard Navigation Buttons ═══ */
.wizard-buttons { display: flex; gap: 0.75rem; margin-top: clamp(1.25rem, 3vw, 1.75rem); }
.wizard-buttons .btn { flex: 1; }
.wizard-buttons .wizard-prev { flex: 0 0 auto; width: auto; min-width: 0; max-width: 140px; padding-left: 1.25rem; padding-right: 1.25rem; }

/* ═══ Google Pending ═══ */
.google-pending-info {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(66,133,244,0.1), rgba(66,133,244,0.02));
    border: 1px solid rgba(66,133,244,0.2); border-radius: 14px;
    margin-bottom: 1.5rem; gap: 0.75rem;
}
.google-user { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.google-icon-wrapper {
    width: 42px; height: 42px; background: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08); flex-shrink: 0;
}
.google-details { display: flex; flex-direction: column; min-width: 0; }
.google-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-main); }
.google-email { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-change-google {
    font-size: 0.82rem; font-weight: 600; color: var(--primary);
    padding: 0.5rem 1rem; border: 2px solid var(--primary); border-radius: 10px;
    white-space: nowrap; transition: all 0.2s;
}
.btn-change-google:hover { background: var(--primary); color: #fff; }

.google-password-alert {
    display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem;
    background: rgba(15,76,129,0.05); border-left: 3px solid var(--primary);
    border-radius: 10px; margin-bottom: 1.25rem;
}
.google-password-alert i { color: var(--primary); font-size: 1.2rem; margin-top: 2px; }
.google-password-alert strong { display: block; font-size: 0.9rem; margin-bottom: 0.2rem; color: var(--text-main); }
.google-password-alert p { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ═══ Terms ═══ */
.terms-text { font-size: 0.82rem; color: var(--text-muted); margin-top: 1.25rem; line-height: 1.6; text-align: center; }
.terms-text a { color: var(--primary); font-weight: 600; }

/* ═══ Step Summary Card ═══ */
.step-info-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(40,167,69,0.08), rgba(40,167,69,0.02));
    border: 1px solid rgba(40,167,69,0.15);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.step-info-card i { color: var(--success); font-size: 1rem; flex-shrink: 0; }

/* ═══ Responsividade Avançada ═══ */

/* Tablets & below */
@media (max-width: 768px) {
    .auth-page { align-items: flex-start; padding-top: 1rem; }
    .type-cards { grid-template-columns: 1fr; gap: 0.75rem; }
    .form-row { flex-direction: column; gap: 0; }
    .wizard-buttons { flex-direction: column-reverse; gap: 0.6rem; }
    .wizard-buttons .wizard-prev { flex: 1; min-width: unset; max-width: none; width: 100%; }
    .google-pending-info { flex-direction: column; align-items: stretch; }
    .btn-change-google { text-align: center; justify-content: center; display: flex; }
}

/* Small phones */
@media (max-width: 380px) {
    .auth-container { padding: 1.25rem 1rem; border-radius: 16px; }
    .progress-step small { font-size: 0.58rem; }
    .panel-header h2 { font-size: 1.2rem; }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-page { align-items: flex-start; padding: 0.75rem; }
    .auth-container { border-radius: 14px; }
}

/* Large screens */
@media (min-width: 1200px) {
    .auth-container { max-width: 640px; }
}

/* ═══ Premium Select Fix ═══ */
.auth-form .premium-select { z-index: 100; }
.auth-form .ps-dropdown { z-index: 1000; }
.auth-form .premium-select--searchable .ps-dropdown { min-width: 280px; }

/* ═══ Auth Divider for sections ═══ */
.auth-form .auth-divider span { font-weight: 600; color: var(--text-main); font-size: 0.85rem; }
