/* =============================================================================
   Ad Audit Pro - Styles
   ============================================================================= */

:root {
    /* Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f97316;
    --danger: #dc2626;

    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;

    /* Facebook Blue */
    --facebook: #1877f2;
    --facebook-dark: #166fe5;

    /* 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: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* =============================================================================
   Container
   ============================================================================= */

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   Progress Bar
   ============================================================================= */

.progress-container {
    margin-bottom: var(--space-xl);
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 33.33%;
    transition: width 0.3s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    padding: 0 var(--space-lg);
}

.progress-steps .step {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.progress-steps .step.active {
    background: var(--primary);
    color: white;
}

.progress-steps .step.completed {
    background: var(--success);
    color: white;
}

/* =============================================================================
   Step Content
   ============================================================================= */

.step-content {
    display: none;
    animation: fadeIn 0.3s 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-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    line-height: 1.2;
}

.step-header .highlight {
    color: var(--primary);
}

.step-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* =============================================================================
   Forms
   ============================================================================= */

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-group input,
.form-group select {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-card);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* =============================================================================
   Buttons
   ============================================================================= */

.btn {
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    color: var(--text);
}

.btn-facebook {
    background: var(--facebook);
    color: white;
    font-size: 1.125rem;
    padding: var(--space-lg);
}

.btn-facebook:hover {
    background: var(--facebook-dark);
}

.btn-facebook .fb-icon {
    width: 24px;
    height: 24px;
}

/* =============================================================================
   Trust Badges
   ============================================================================= */

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.trust-badges span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.trust-badges.vertical {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* =============================================================================
   OAuth Section
   ============================================================================= */

.oauth-section {
    text-align: center;
}

.oauth-section .btn-facebook {
    width: 100%;
    margin-bottom: var(--space-lg);
}

.divider {
    display: flex;
    align-items: center;
    margin: var(--space-xl) 0;
    color: var(--text-muted);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 var(--space-md);
    font-size: 0.875rem;
}

.skip-note {
    display: block;
    margin-top: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.privacy-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--space-lg);
}

/* =============================================================================
   Loading
   ============================================================================= */

.loading-container {
    text-align: center;
    padding: var(--space-2xl) 0;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-lg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    transition: opacity 0.3s ease;
}

.loading-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.loading-step {
    opacity: 0.4;
    transition: opacity 0.3s;
}

.loading-step.active {
    opacity: 1;
    color: var(--primary);
    font-weight: 500;
}

/* =============================================================================
   Results Page
   ============================================================================= */

.results-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(
        var(--score-color, var(--primary)) calc(var(--score, 0) * 3.6deg),
        var(--border) 0
    );
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 170px;
    height: 170px;
    background: var(--bg-card);
    border-radius: 50%;
}

.score-circle .score-value {
    position: relative;
    font-size: 3.5rem;
    font-weight: 800;
    z-index: 1;
}

.score-circle .score-label {
    position: relative;
    font-size: 0.875rem;
    color: var(--text-muted);
    z-index: 1;
}

.score-interpretation {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--score-color, var(--primary));
}

.score-interpretation h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.score-interpretation p {
    color: var(--text-muted);
}

/* Sub-scores */
.sub-scores {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.sub-score-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.sub-score-card .score {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.sub-score-card .label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.metric-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.metric-card .icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.metric-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.metric-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Recommendations */
.recommendations {
    margin-bottom: var(--space-xl);
}

.recommendations h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
}

.recommendation-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    border-left: 4px solid var(--border);
}

.recommendation-card.critical {
    border-left-color: var(--danger);
}

.recommendation-card.warning {
    border-left-color: var(--warning);
}

.recommendation-card.success {
    border-left-color: var(--success);
}

.recommendation-card .header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.recommendation-card .icon {
    font-size: 1.25rem;
}

.recommendation-card .title {
    font-weight: 600;
}

.recommendation-card .message {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.recommendation-card .action {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    color: white;
}

.cta-section h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
}

.cta-section .btn {
    background: white;
    color: var(--primary);
    width: 100%;
}

.cta-section .btn:hover {
    background: var(--bg);
}

/* Generic Audit Banner */
.generic-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.generic-banner h3 {
    color: #92400e;
    margin-bottom: var(--space-sm);
}

.generic-banner p {
    color: #78350f;
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 480px) {
    .container {
        padding: var(--space-md);
    }

    .step-header h1 {
        font-size: 1.5rem;
    }

    .sub-scores {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   Score Colors
   ============================================================================= */

.score-critical { --score-color: var(--danger); }
.score-needs_improvement { --score-color: var(--warning); }
.score-good { --score-color: #eab308; }
.score-excellent { --score-color: var(--success); }
