/* ════════════════════════════════════════════
   Customer Reality Score — Stylesheet
   ════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
    --bg-primary: #FBF8F4;
    --bg-white: #FFFFFF;
    --bg-card-dark: #1A1A1A;
    --bg-card-body: #222222;

    --text-primary: #1A1A1A;
    --text-secondary: #555555;
    --text-muted: #999999;
    --text-light: #FFFFFF;
    --text-light-muted: #AAAAAA;

    --accent: #E8553A;
    --accent-hover: #D44A31;
    --accent-glow: rgba(232, 85, 58, 0.25);
    --accent-light: rgba(232, 85, 58, 0.08);

    --border: #E5E0DA;
    --border-light: #F0EBE5;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.3);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* ── Utilities ── */
.hidden {
    display: none !important;
}

/* ════════════════════════════════════════════
   Navigation
   ════════════════════════════════════════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.brand em {
    font-style: italic;
    color: var(--accent);
}

.nav-tagline {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ════════════════════════════════════════════
   Hero Section
   ════════════════════════════════════════════ */
.hero {
    padding: 80px 24px 60px;
    text-align: center;
}

.hero-inner {
    max-width: 640px;
    margin: 0 auto;
}

/* Badge */
.badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid rgba(232, 85, 58, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 32px;
    animation: fadeInDown 0.6s ease-out;
}

.badge-star {
    margin-right: 4px;
}

/* Heading */
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.7s ease-out 0.1s both;
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
}

/* Subtitle */
.subtitle {
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.7s ease-out 0.2s both;
}

/* ════════════════════════════════════════════
   Form
   ════════════════════════════════════════════ */
.score-form {
    max-width: 520px;
    margin: 0 auto;
    animation: fadeInUp 0.7s ease-out 0.3s both;
}

.input-row {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.url-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 20px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
}

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

.submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 24px;
    border: none;
    background: var(--text-primary);
    color: var(--text-light);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
}

.submit-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

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

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

.btn-loader {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}



/* ════════════════════════════════════════════
   Loading Skeleton
   ════════════════════════════════════════════ */
.loading-section {
    padding: 0 24px 60px;
}

.loading-card {
    max-width: 680px;
    margin: 0 auto;
    background: var(--bg-card-dark);
    border-radius: var(--radius-lg);
    padding: 28px 32px 32px;
    box-shadow: var(--shadow-card);
}

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

.skeleton {
    background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}

.skeleton-text {
    height: 18px;
}

.skeleton-badge {
    width: 120px;
    height: 28px;
    border-radius: 6px;
}

.loading-body {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 24px;
}

.skeleton-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    flex-shrink: 0;
}

.loading-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-bar {
    height: 20px;
    width: 100%;
}

.loading-message {
    text-align: center;
    color: var(--text-light-muted);
    font-size: 14px;
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════
   Results Card
   ════════════════════════════════════════════ */
.results-section {
    padding: 0 24px 60px;
    animation: fadeInUp 0.6s ease-out;
}

.results-card {
    max-width: 680px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.10), 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: var(--bg-card-dark);
    border-bottom: none;
}

.results-scored {
    font-size: 14px;
    color: var(--text-light-muted);
}

.results-scored strong {
    color: var(--text-light);
    font-weight: 700;
}

.reality-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--accent);
    border: 1.5px solid var(--accent);
    padding: 4px 12px;
    border-radius: 6px;
}

/* Body */
.results-body {
    display: flex;
    gap: 36px;
    padding: 36px 32px;
    align-items: center;
    background: var(--bg-white);
}

/* Donut Chart */
.chart-column {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.donut-wrapper {
    position: relative;
    width: 170px;
    height: 170px;
}

.donut-chart {
    width: 100%;
    height: 100%;
}

.donut-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-sans);
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.score-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Score Bars */
.bars-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.score-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 155px;
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 10px;
    background: #E8E4DE;
    border-radius: 100px;
    overflow: hidden;
    min-width: 80px;
}

.bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #E8553A, #F0785E);
    border-radius: 100px;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bar-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 28px;
    text-align: right;
}

/* Footer */
.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg-white);
}

.footer-hint {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.embed-btn {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.embed-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ── Improvement Tips ── */
.improvement-tips {
    max-width: 680px;
    margin: 28px auto 0;
    padding: 24px 28px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: fadeInUp 0.5s ease-out;
}

.improvement-tips h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    margin-bottom: 14px;
    color: var(--text-primary);
}

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

.improvement-tips li {
    position: relative;
    padding-left: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.improvement-tips li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

/* ════════════════════════════════════════════
   How It Works
   ════════════════════════════════════════════ */
.how-it-works {
    padding: 80px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.section-inner {
    max-width: 900px;
    margin: 0 auto;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.how-it-works h2 {
    font-family: var(--font-serif);
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 48px;
    letter-spacing: -0.3px;
}

.criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    text-align: left;
}

.criteria-card {
    padding: 28px 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--border-light);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.criteria-card:hover {
    border-color: var(--border);
    border-top-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.num-badge {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1;
}

.criteria-card h3 {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.criteria-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ════════════════════════════════════════════
   CTA Section
   ════════════════════════════════════════════ */
.cta-section {
    padding: 80px 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #F5EDE5 100%);
    border-top: 1px solid var(--border);
}

.cta-section h2 {
    font-family: var(--font-serif);
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.cta-section p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--accent);
    color: var(--text-light);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.cta-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* ════════════════════════════════════════════
   Footer
   ════════════════════════════════════════════ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════
   Embed Modal
   ════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease-out;
}

.modal-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s var(--transition-spring);
}

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

.modal-header h3 {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F0F0F0;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: #E0E0E0;
}

.modal-body p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.embed-code {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FAFAFA;
    color: var(--text-primary);
    resize: none;
    margin-bottom: 12px;
}

.copy-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--text-primary);
    color: var(--text-light);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover {
    background: #333;
}

.copy-btn.copied {
    background: #16A34A;
}

/* ════════════════════════════════════════════
   Animations
   ════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes countUp {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero {
        padding: 60px 20px 40px;
    }

    .results-body {
        flex-direction: column;
        gap: 28px;
        padding: 24px 20px;
    }

    .chart-column {
        width: 100%;
    }

    .donut-wrapper {
        width: 140px;
        height: 140px;
    }

    .donut-score {
        font-size: 40px;
    }

    .bars-column {
        width: 100%;
    }

    .bar-label {
        min-width: 120px;
        font-size: 12px;
    }

    .results-header,
    .results-footer {
        padding: 14px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

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

    .input-row {
        flex-direction: column;
    }

    .submit-btn {
        justify-content: center;
        padding: 16px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 15px;
    }

    .badge {
        font-size: 10px;
        padding: 5px 12px;
    }

    .score-bar-item {
        gap: 8px;
    }

    .bar-label {
        min-width: 100px;
        font-size: 11px;
    }
}
