/**
 * Estilos de Autenticacao - Rede SX
 * Login e Cadastro - TEMA CLARO FORCADO
 */

/* Force Light Theme */
:root {
    color-scheme: light only;
}

/* Dark Mode - DESABILITADO (forçando tema claro) */
/* @media (prefers-color-scheme: dark) {
    .auth-page,
    .auth-page * {
        color-scheme: light only !important;
    }
} */

.auth-page {
    background: linear-gradient(135deg, #f8f4ff 0%, #f3e8ff 50%, #ede9fe 100%);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.auth-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-md);
    padding-top: max(env(safe-area-inset-top, 20px), 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 60px);
    min-height: auto;
    width: 100%;
}

/* Container de Auth */
.auth-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    animation: scaleIn var(--transition-normal);
}

/* Logo */
.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo img,
.auth-logo .logo-img {
    width: 120px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    margin: 0 auto var(--spacing-md);
    display: block;
}

.auth-logo-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-md);
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.auth-logo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Titulo da pagina */
.auth-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.auth-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Formulario */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Links */
.auth-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
    margin-top: var(--spacing-lg);
}

.auth-links a {
    color: var(--roxo-principal);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-links a:hover {
    color: var(--roxo-claro);
    text-decoration: underline;
}

.auth-links .divider-text {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

/* Barra de Progresso do Cadastro */
.cadastro-progress {
    margin-bottom: var(--spacing-lg);
}

.cadastro-progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.cadastro-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.cadastro-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cadastro-progress-step {
    font-weight: 600;
    color: var(--roxo-principal);
}

/* Selecao de Tipo de Perfil */
.profile-type-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.profile-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-type-option:hover {
    border-color: var(--roxo-claro);
}

.profile-type-option.selected {
    border-color: var(--roxo-principal);
    background: rgba(147, 51, 234, 0.1);
}

.profile-type-option input {
    display: none;
}

.profile-type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: var(--radius-full);
    font-size: 1.5rem;
}

.profile-type-icon svg {
    width: 28px;
    height: 28px;
}

.profile-type-icon.icon-male svg {
    stroke: #3b82f6;
}

.profile-type-icon.icon-female svg {
    stroke: #ec4899;
}

.profile-type-icon.icon-couple svg {
    width: 20px;
    height: 20px;
}

.profile-type-icon.icon-couple svg:first-child {
    stroke: #3b82f6;
    margin-right: -4px;
}

.profile-type-icon.icon-couple svg:last-child {
    stroke: #ec4899;
}

.profile-type-option.selected .profile-type-icon {
    background: var(--gradient-primary);
}

.profile-type-option.selected .profile-type-icon svg {
    stroke: white;
}

/* Force light theme on inputs */
.auth-page input:not([type="checkbox"]):not([type="radio"]),
.auth-page select,
.auth-page textarea {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
    -webkit-appearance: none;
}

/* Checkboxes - restaurar aparencia nativa */
.auth-page input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 20px !important;
    height: 20px !important;
    accent-color: #9333ea;
    cursor: pointer;
}

.auth-page input::placeholder {
    color: #9ca3af !important;
}

.auth-page input:focus,
.auth-page select:focus {
    border-color: #9333ea !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Date input mask styling */
.auth-page input[type="text"].date-mask {
    font-family: inherit;
}

.profile-type-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* Campos de Casal (lado a lado) */
.casal-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.casal-field-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.casal-field-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--roxo-principal);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-light);
}

/* Chips de Selecao (Interesses/Fetiches) */
.selection-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.selection-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.selection-chip:hover {
    border-color: var(--roxo-principal);
}

.selection-chip.selected {
    background: var(--roxo-principal);
    border-color: var(--roxo-principal);
    color: white;
}

.selection-chip input {
    display: none;
}

/* Checkbox customizado para termos */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.checkbox-label:hover {
    border-color: var(--roxo-principal);
    background: rgba(147, 51, 234, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    accent-color: #9333ea;
    cursor: pointer;
    margin-top: 2px;
}

.checkbox-custom {
    display: none;
}

.checkbox-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.checkbox-text a {
    color: var(--roxo-principal);
    text-decoration: underline;
}

.checkbox-text a:hover {
    text-decoration: none;
}

/* Resumo do cadastro */
.cadastro-resumo {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.cadastro-resumo h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--roxo-principal);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-light);
}

.cadastro-resumo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: var(--spacing-xs) 0;
}

.cadastro-resumo p strong {
    color: var(--text-primary);
}

/* Alert de erro */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

/* Botoes de Navegacao */
.auth-nav-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.auth-nav-buttons .btn {
    flex: 1;
}

/* Codigo SX / Codigo de Acesso */
.code-display {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin: var(--spacing-md) 0;
}

.code-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.code-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--roxo-principal);
    font-family: monospace;
    letter-spacing: 2px;
}

.code-copy-btn {
    margin-top: var(--spacing-sm);
    font-size: 0.75rem;
}

/* Sucesso do Cadastro */
.cadastro-success {
    text-align: center;
    padding: var(--spacing-xl);
}

.cadastro-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: var(--verde);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn var(--transition-normal);
}

.cadastro-success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.cadastro-success h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.cadastro-success p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Responsividade */
@media (max-width: 480px) {
    .auth-container {
        padding: var(--spacing-lg);
        border-radius: var(--radius-lg);
    }

    .profile-type-select {
        grid-template-columns: 1fr;
    }

    .profile-type-option {
        flex-direction: row;
        justify-content: flex-start;
    }

    .casal-fields {
        grid-template-columns: 1fr;
    }
}

/* Animacao de transicao entre etapas */
.etapa-enter {
    animation: slideUp var(--transition-normal);
}

.etapa-exit {
    animation: fadeOut var(--transition-fast);
}

/* Estilos para inputs com ícones inline */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    z-index: 2;
    color: #9ca3af;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-input-with-icon {
    padding-left: 48px !important;
}

.input-with-icon:focus-within .input-icon {
    color: var(--roxo-principal);
}

.form-input-with-icon:focus {
    padding-left: 48px !important;
}

/* ==================== TEMA ESCURO LOGIN ==================== */
:root[data-theme="dark"] .auth-page {
    background: #2e2e2e;
}

:root[data-theme="dark"] .auth-layout {
    background: #000000;
}

:root[data-theme="dark"] .auth-container {
    background: #171717;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .auth-logo h1 {
    color: #ffffff;
}

:root[data-theme="dark"] .auth-logo p {
    color: #a3a3a3;
}

:root[data-theme="dark"] .auth-form .form-label {
    color: #ffffff;
}

:root[data-theme="dark"] .auth-page input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] .auth-page select,
:root[data-theme="dark"] .auth-page textarea {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
}

:root[data-theme="dark"] .auth-links a {
    color: #a78bfa;
}

:root[data-theme="dark"] .auth-links a:hover {
    color: #c4b5fd;
}

:root[data-theme="dark"] .auth-links .divider-text {
    color: #737373;
}

:root[data-theme="dark"] .auth-links p {
    color: #a3a3a3;
}

:root[data-theme="dark"] .input-icon {
    color: #9ca3af;
}

:root[data-theme="dark"] .input-with-icon:focus-within .input-icon {
    color: var(--roxo-principal);
}

/* Alert tema escuro */
:root[data-theme="dark"] .alert-warning {
    background: rgba(254, 243, 199, 0.9) !important;
}

/* Theme toggle button ajuste para escuro */
:root[data-theme="dark"] .theme-toggle {
    background: #1a1a1a;
    border-color: #404040;
}

:root[data-theme="dark"] .theme-toggle:hover {
    border-color: var(--roxo-principal);
}

:root[data-theme="dark"] .theme-toggle-label {
    color: #ffffff;
}
