* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-gray: #86868b;
    --apple-dark: #1d1d1f;
    --apple-light: #f5f5f7;
    --apple-card: rgba(255, 255, 255, 0.8);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
}

html {
    scroll-behavior: smooth;
}

header{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.right{
  display:flex;
  align-items:center;
  gap:18px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
    color: var(--apple-dark);
    line-height: 1.47059;
    font-weight: 400;
    letter-spacing: -0.022em;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.bg-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 113, 227, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 55, 95, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}


/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 0 60px;
    position: relative;
}

.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    border-radius: 20px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.25);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.hero-icon:hover {
    transform: translateY(-4px);
}

h1 {
    font-size: 56px;
    line-height: 1.07143;
    font-weight: 700;
    letter-spacing: -0.005em;
    margin-bottom: 16px;
    background: linear-gradient(90deg, #1d1d1f 0%, #434344 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 21px;
    line-height: 1.381;
    font-weight: 400;
    letter-spacing: .011em;
    color: var(--apple-gray);
    max-width: 600px;
    margin: 0 auto;
}


/* Quiz icon */
.quiz-icon-text {
    width: 360px;
    height: 100px;
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    border-radius: 20px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: white;
    text-align: center;
    line-height: 1.2;
    letter-spacing: 2px;
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}



/* Input Card - Glassmorphism */
.input-card {
    background: var(--apple-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    margin: 40px auto;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: 720px;
    transition: box-shadow 0.3s ease;
}

.input-card:hover {
    box-shadow: var(--shadow-hover);
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
    h1 { font-size: 40px; }
    .hero { padding: 80px 0 40px; }
}

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

label {
    font-size: 12px;
    line-height: 1.33337;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--apple-gray);
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-left: 4px;
}

input {
    height: 56px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 17px;
    font-family: inherit;
    color: var(--apple-dark);
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
}

input:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

input:hover {
    border-color: #86868b;
}

button {
    height: 56px;
    background: var(--apple-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 32px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
}

button:hover {
    background: var(--apple-blue-hover);
    transform: scale(1.02);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    display: none;
}

.results-grid.visible {
    display: grid;
    opacity: 1;
    transform: translateY(0);
}

.metric-card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease;
}

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

.metric-card.highlight {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
    color: white;
}

.metric-label {
    font-size: 13px;
    line-height: 1.38462;
    font-weight: 600;
    letter-spacing: -0.008em;
    color: var(--apple-gray);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-label.light {
    color: rgba(255,255,255,0.9);
}

.metric-value {
    font-size: 32px;
    line-height: 1.125;
    font-weight: 700;
    letter-spacing: -0.021em;
    color: var(--apple-dark);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.metric-value.light {
    color: white;
    font-size: 28px;
}

.metric-sub {
    font-size: 15px;
    color: var(--apple-gray);
    margin-top: 4px;
    font-weight: 500;
}

.metric-sub.light {
    color: rgba(255,255,255,0.8);
}

.metric-positive { color: #34c759; }
.metric-negative { color: #ff3b30; }

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 24px;
    padding: 32px;
    margin: 40px 0;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: none;
}

.chart-container.visible {
    display: block;
    animation: fadeIn 0.6s ease;
}

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

.chart-header {
    margin-bottom: 24px;
}

.chart-title {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.021em;
    margin-bottom: 4px;
}

.chart-subtitle {
    font-size: 15px;
    color: var(--apple-gray);
}

canvas {
    max-height: 400px;
}

/* Stats Section */
.stats-section {
    background: white;
    border-radius: 24px;
    padding: 32px;
    margin: 40px 0 80px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.2s;
    display: none;
}

.stats-section.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 24px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f7;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 15px;
    color: var(--apple-gray);
}

.stat-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--apple-dark);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

/* Loading Animation */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--apple-gray);
    font-size: 13px;
    opacity: 0.8;
}

/* Error Toast */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff3b30;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
