/* ==========================================================================
   Sistema OAuth - Dark Luxury Theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables & Root
   -------------------------------------------------------------------------- */
:root {
    /* Colors - Dark Luxury Palette */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.8);
    --bg-card-hover: rgba(24, 24, 35, 0.9);
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);
    
    /* Status Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --error: #ef4444;
    --pending: #6b7280;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Container & Layout
   -------------------------------------------------------------------------- */
.container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-blur-1, .bg-blur-2 {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.bg-blur-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.15);
    top: -100px;
    left: -100px;
    animation: float 20s ease-in-out infinite;
}

.bg-blur-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.1);
    bottom: -50px;
    right: -50px;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -30px); }
    50% { transform: translate(-20px, 20px); }
    75% { transform: translate(20px, 10px); }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    margin-bottom: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Main Card
   -------------------------------------------------------------------------- */
.main-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   Progress Steps
   -------------------------------------------------------------------------- */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xl);
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
    position: relative;
}

.step-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.step-check {
    width: 20px;
    height: 20px;
    color: white;
    display: none;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition-base);
}

.progress-line {
    width: 60px;
    height: 2px;
    background: var(--border-subtle);
    margin: 0 var(--space-sm);
    margin-bottom: 24px;
    transition: var(--transition-base);
}

/* Active Step */
.progress-step.active .step-circle {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 20px var(--accent-glow);
}

.progress-step.active .step-number {
    color: var(--accent-primary);
}

.progress-step.active .step-label {
    color: var(--text-primary);
}

/* Completed Step */
.progress-step.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
}

.progress-step.completed .step-number {
    display: none;
}

.progress-step.completed .step-check {
    display: block;
}

.progress-step.completed .step-label {
    color: var(--success);
}

.progress-step.completed + .progress-line {
    background: var(--success);
}

/* --------------------------------------------------------------------------
   Step Content
   -------------------------------------------------------------------------- */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.step-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-lg);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon svg {
    width: 40px;
    height: 40px;
}

.consent-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: var(--accent-primary);
}

.google-icon {
    background: rgba(255, 255, 255, 0.05);
}

.microsoft-icon {
    background: rgba(255, 255, 255, 0.05);
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Info Cards
   -------------------------------------------------------------------------- */
.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.info-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.info-card ul {
    list-style: none;
}

.info-card li {
    position: relative;
    padding-left: var(--space-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.info-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
}

/* --------------------------------------------------------------------------
   Consent Box
   -------------------------------------------------------------------------- */
.consent-box {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    cursor: pointer;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.checkbox-container input:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkmark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: var(--transition-fast);
}

.checkbox-container input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.consent-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.consent-text a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.consent-text a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: var(--shadow-sm), 0 0 20px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
    box-shadow: var(--shadow-md), 0 0 30px var(--success-glow);
}

/* OAuth Buttons */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.btn-oauth {
    width: 100%;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    justify-content: flex-start;
    gap: var(--space-md);
}

.btn-oauth:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-oauth:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-oauth.connected {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.oauth-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.oauth-icon svg {
    width: 24px;
    height: 24px;
}

.oauth-text {
    flex: 1;
    text-align: left;
}

.oauth-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.oauth-status {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

.oauth-action {
    display: flex;
    align-items: center;
}

.status-icon {
    font-size: 12px;
}

.status-icon.pending {
    color: var(--pending);
}

.status-icon.success {
    color: var(--success);
    font-size: 20px;
}

/* --------------------------------------------------------------------------
   Success Screen
   -------------------------------------------------------------------------- */
.success-container {
    text-align: center;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-xl);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successPulse 2s ease-in-out infinite;
}

.success-icon svg {
    width: 50px;
    height: 50px;
    color: var(--success);
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--success-glow);
    }
    50% {
        box-shadow: 0 0 30px 10px var(--success-glow);
    }
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--success);
}

.success-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.success-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
}

.info-item:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.info-item .info-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-item .info-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.info-item strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.info-item p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    position: relative;
    z-index: 10;
    margin-top: var(--space-xl);
    text-align: center;
    padding: var(--space-lg);
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .container {
        padding: var(--space-md);
    }
    
    .main-card {
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }
    
    .progress-container {
        gap: 0;
    }
    
    .progress-line {
        width: 40px;
    }
    
    .step-label {
        display: none;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   Loading State
   -------------------------------------------------------------------------- */
.btn.loading {
    pointer-events: none;
    position: relative;
}

.btn.loading span {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
