.noise {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 40px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--cream);
}

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

.btn-new {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--bg-subtle);
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--coral);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: var(--text-muted);
    font-size: 16px;
}

.routine-section {
    margin-bottom: 60px;
}

.routine-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.routine-title .emoji {
    font-size: 32px;
}

.routine-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.step-card:hover {
    border-color: rgba(255, 107, 107, 0.2);
    background: rgba(255, 107, 107, 0.02);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 107, 107, 0.1);
    color: var(--coral);
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    flex-shrink: 0;
}

.step-title {
    font-weight: 600;
    font-size: 16px;
}

.step-action {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    font-size: 14px;
}

.product-name {
    font-weight: 500;
}

.product-brand {
    color: var(--text-dim);
    font-size: 12px;
}

.product-price {
    color: var(--gold);
    font-weight: 600;
}

.tips-section {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
}

.tips-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tip-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(232, 200, 114, 0.05);
    border-left: 2px solid var(--gold);
    border-radius: 4px;
    font-size: 14px;
}

.tip-icon {
    color: var(--gold);
    font-weight: 700;
}

.budget-section {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(232, 200, 114, 0.05));
    border: 1px solid rgba(255, 107, 107, 0.1);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.budget-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.budget-breakdown {
    color: var(--text);
    font-size: 16px;
    line-height: 1.8;
}

.product-why {
    margin-top: 12px;
    padding: 12px;
    background: rgba(232, 200, 114, 0.05);
    border-left: 2px solid var(--gold);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.product-why::before {
    content: "💡";
    flex-shrink: 0;
}

.skin-explanation {
    line-height: 1.8;
    color: var(--text-muted);
}

.skin-explanation strong {
    color: var(--coral);
}

.skin-explanation p {
    margin-bottom: 12px;
}

.skin-traits {
    margin: 12px 0;
    padding-left: 20px;
}

.skin-traits li {
    margin-bottom: 6px;
}

.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--coral);
    border-radius: 8px;
    padding: 20px;
    color: var(--coral);
    text-align: center;
}

@media (max-width: 640px) {
    .container {
        padding: 40px 20px;
    }

    nav {
        margin-bottom: 40px;
    }

    .routine-title {
        font-size: 22px;
    }

    .routine-title .emoji {
        font-size: 28px;
    }

    .routine-section {
        margin-bottom: 40px;
    }

    .step-card {
        padding: 20px;
    }

    .product-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }

    .product-price {
        font-size: 16px;
        padding: 4px 0;
    }

    /* Ensure button touch targets */
    .btn-new {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Better readability on small screens */
    .step-title {
        font-size: 15px;
        line-height: 1.4;
    }

    .product-name {
        font-size: 15px;
        line-height: 1.4;
    }

    .tips-section,
    .budget-section {
        padding: 20px;
    }

    .tip-item {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* Error state styles */
.error-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 16px;
    text-align: center;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--coral);
    margin-bottom: 12px;
}

.error-message {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.retry-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #FF6B6B, #F4A4A0);
    color: white;
    border: none;
    border-radius: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

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

@media (max-width: 640px) {
    .error-container {
        padding: 32px 24px;
    }

    .error-icon {
        font-size: 56px;
    }

    .error-title {
        font-size: 20px;
    }

    .error-message {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 32px 16px;
    }

    nav {
        margin-bottom: 32px;
        padding-bottom: 16px;
    }

    .logo {
        font-size: 18px;
    }

    .btn-new {
        padding: 10px 16px;
        font-size: 13px;
    }

    .routine-title {
        font-size: 20px;
    }

    .routine-title .emoji {
        font-size: 24px;
    }

    .routine-section {
        margin-bottom: 32px;
    }

    .step-card {
        padding: 16px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .step-title {
        font-size: 14px;
    }

    .product-info {
        padding: 12px;
        font-size: 13px;
    }

    .product-name {
        font-size: 14px;
    }

    .tips-section,
    .budget-section {
        padding: 16px;
    }

    .tips-title {
        font-size: 16px;
    }

    .tip-item {
        font-size: 14px;
        padding: 10px;
    }

    .budget-breakdown {
        font-size: 15px;
    }
}
