/* ============================================
   AI SEO Scanner — Global Stylesheet
   ============================================ */

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

:root {
    --primary: #2C3E50;
    --primary-dark: #1a252f;
    --primary-light: #3d566e;
    --accent: #00FFC8;
    --accent-dark: #00e6b4;
    --success: #16a34a;
    --warning: #ca8a04;
    --orange: #ea580c;
    --danger: #dc2626;
    --text-primary: #0F172A;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-page: #f8fafc;
    --bg-subtle: #f0fdf9;
    --bg-gray: #f1f3f4;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius-sm: 6px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-full: 100px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-primary: 0 8px 24px rgba(0, 255, 200, 0.25);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---- LAYOUT ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.container--narrow {
    max-width: 900px;
}

.container--xs {
    max-width: 640px;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    letter-spacing: -0.3px;
}

h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; letter-spacing: -1px; }
h2 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 16px; font-weight: 700; }

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

.text-gradient {
    color: var(--accent);
}

/* ---- NAVIGATION ---- */
nav {
    padding: 20px 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--text-primary);
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    transition: opacity var(--transition);
}

.nav-link:hover {
    opacity: 0.7;
}

/* ---- HERO ---- */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg-white) 100%);
}

.hero-badge {
    display: inline-block;
    background: rgba(0, 255, 200, 0.15);
    color: #0F172A;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 24px;
    border: 1px solid rgba(0, 255, 200, 0.3);
}

.hero h1 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* ---- CARDS ---- */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card--elevated {
    box-shadow: var(--shadow-md);
}

.card--centered {
    text-align: center;
}

/* ---- FORM ---- */
.form-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px;
    max-width: 640px;
    margin: -20px auto 0;
    box-shadow: var(--shadow-md);
}

.form-card h2 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 8px;
}

.form-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 200, 0.15);
}

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

.form-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 16px;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-family);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn--primary {
    background: var(--accent);
    color: #0F172A;
    font-weight: 700;
}

.btn--primary:hover {
    box-shadow: var(--shadow-primary);
    background: var(--accent-dark);
}

.btn--secondary {
    background: #0F172A;
    color: #ffffff;
}

.btn--secondary:hover {
    background: #1e293b;
}

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

.btn--white:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.btn--lg {
    padding: 16px 36px;
    font-size: 17px;
    font-weight: 700;
    border-radius: var(--radius-md);
}

.btn--block {
    display: flex;
    width: 100%;
}

.cta-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #0F172A;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    margin-top: 24px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    background: var(--accent-dark);
}

.cta-button:active {
    transform: translateY(0);
}

.cta-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---- PROGRESS BAR ---- */
.progress-section {
    display: none;
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 0;
}

.progress-section.active {
    display: block;
}

.progress-card {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
}

.progress-card h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.progress-status {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-percentage {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ---- SECTION HEADINGS ---- */
.section-label {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.section-title {
    text-align: center;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 48px;
    letter-spacing: -0.5px;
}

.section-title--left {
    text-align: left;
    font-size: 22px;
    margin-bottom: 24px;
}

/* ---- STEPS GRID (How It Works) ---- */
.how-it-works {
    padding: 80px 0;
    background: var(--bg-page);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #0F172A;
    font-size: 20px;
    font-weight: 700;
    border-radius: 10px;
    margin-bottom: 20px;
}

.step-card h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.step-card p {
    font-size: 14px;
    line-height: 1.6;
}

/* ---- ANALYZE CARDS (What We Analyze) ---- */
.analyze-section {
    padding: 80px 0;
}

.analyze-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.analyze-card {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.analyze-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.analyze-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.analyze-card:nth-child(1) .analyze-icon { background: rgba(0, 255, 200, 0.15); }
.analyze-card:nth-child(2) .analyze-icon { background: #e0f2fe; }
.analyze-card:nth-child(3) .analyze-icon { background: #d1fae5; }
.analyze-card:nth-child(4) .analyze-icon { background: #fef3c7; }
.analyze-card:nth-child(5) .analyze-icon { background: #e2e8f0; }

.analyze-card h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.analyze-card p {
    font-size: 13px;
    line-height: 1.5;
}

/* ---- SCORE CARD (Results Page) ---- */
.score-hero {
    padding: 48px 0 40px;
}

.score-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.score-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.score-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.score-url {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
    word-break: break-all;
}

.score-ring-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.score-ring {
    position: relative;
    width: 180px;
    height: 180px;
}

.score-ring svg {
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 10;
}

.score-ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s ease;
}

.score-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
}

.score-total {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 500;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-xl);
    font-size: 48px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
}

.grade-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.score-summary {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---- CATEGORY BREAKDOWN (Results Page) ---- */
.categories-section {
    padding: 0 0 40px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.cat-tech .category-icon { background: rgba(0, 255, 200, 0.15); }
.cat-content .category-icon { background: #e0f2fe; }
.cat-entity .category-icon { background: #d1fae5; }
.cat-structured .category-icon { background: #fef3c7; }
.cat-eeat .category-icon { background: #e2e8f0; }

.category-info {
    flex: 1;
    min-width: 0;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.category-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-score-text {
    font-size: 14px;
    font-weight: 700;
}

.category-bar {
    width: 100%;
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
}

/* ---- RECOMMENDATIONS (Results Page) ---- */
.recommendations-section {
    padding: 0 0 40px;
}

.priority-group {
    margin-bottom: 24px;
}

.priority-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.priority-critical {
    background: #fef2f2;
    color: var(--danger);
}

.priority-high {
    background: #fffbeb;
    color: #d97706;
}

.priority-medium {
    background: #eff6ff;
    color: #2563eb;
}

.recommendation-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recommendation-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.recommendation-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.recommendation-item .dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
}

.priority-critical + .recommendation-list .dot { background: var(--danger); }
.priority-high + .recommendation-list .dot { background: #d97706; }
.priority-medium + .recommendation-list .dot { background: #2563eb; }

.no-recommendations {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
}

/* ---- DOWNLOAD CTA (Results Page) ---- */
.download-section {
    padding: 0 0 60px;
}

.download-card {
    background: #0F172A;
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    color: #ffffff;
}

.download-card h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.download-card p {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 28px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    color: #ffffff;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    background: var(--accent);
    color: #0F172A;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-family);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.download-btn svg {
    width: 20px;
    height: 20px;
}

/* ---- ERROR MESSAGE ---- */
.error-message {
    display: none;
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
}

.error-message.active {
    display: block;
}

/* ---- SCORE COLOR UTILITIES ---- */
.color-excellent { color: var(--success); }
.color-good { color: var(--warning); }
.color-needs-work { color: var(--orange); }
.color-poor { color: var(--danger); }

.bg-excellent { background: var(--success); }
.bg-good { background: var(--warning); }
.bg-needs-work { background: var(--orange); }
.bg-poor { background: var(--danger); }

.fill-excellent { stroke: var(--success); }
.fill-good { stroke: var(--warning); }
.fill-needs-work { stroke: var(--orange); }
.fill-poor { stroke: var(--danger); }

/* ---- FAQ SECTION ---- */
.faq-section {
    padding: 80px 0;
    background: var(--bg-page);
}

.faq-list {
    max-width: 740px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 22px;
    font-weight: 300;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.faq-item[open] .faq-question::after {
    content: '−';
}

.faq-answer {
    padding: 0 24px 20px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ---- FOOTER ---- */
footer {
    padding: 32px 0;
    border-top: 1px solid var(--border-light);
    text-align: center;
    background: var(--bg-white);
}

footer p {
    font-size: 13px;
    color: var(--text-light);
}

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 32px 24px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero {
        padding: 60px 0 40px;
    }

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

    .how-it-works,
    .analyze-section {
        padding: 60px 0;
    }
}

@media (max-width: 600px) {
    .score-card {
        padding: 32px 20px;
    }

    .score-ring-wrapper {
        gap: 24px;
    }

    .score-ring {
        width: 140px;
        height: 140px;
    }

    .score-number {
        font-size: 36px;
    }

    .grade-badge {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }

    .category-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .download-card {
        padding: 32px 20px;
    }

    .container {
        padding: 0 16px;
    }
}

@media (max-width: 400px) {
    .cta-button,
    .btn--lg {
        font-size: 15px;
        padding: 14px;
    }

    h1 {
        font-size: 28px;
    }
}
