/* =============================================================================
   EARLY WRITING STARTER - STYLES
   ============================================================================= */

:root {
    --primary-blue: #1B75BC;
    --secondary-orange: #F5A623;
    --success-green: #28A745;
    --warning-amber: #FFC107;
    --info-blue: #17A2B8;
    --error-red: #DC3545;
    --dark-grey: #333333;
    --medium-grey: #666666;
    --light-grey: #F5F5F5;
    --white: #FFFFFF;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #E8F4FC 0%, #FFF9E6 100%);
    min-height: 100vh;
    color: var(--dark-grey);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* =============================================================================
   HEADER
   ============================================================================= */

.header {
    text-align: center;
    padding: 20px 20px 10px;
}

.logo {
    max-width: 180px;
}

/* =============================================================================
   LANDING PAGE
   ============================================================================= */

.landing-page {
    animation: fadeIn 0.5s ease;
}

.hero {
    text-align: center;
    padding: 20px 20px 30px;
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--medium-grey);
    max-width: 600px;
    margin: 0 auto;
}

.hero-image {
    margin: 30px auto 10px;
    max-width: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.feature-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.feature-card p {
    color: var(--medium-grey);
    font-size: 0.95rem;
}

/* How It Works */
.how-it-works {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    margin: 40px 0;
    box-shadow: var(--shadow);
}

.how-it-works h2 {
    text-align: center;
    color: var(--primary-blue);
    margin-bottom: 30px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.step-item {
    text-align: center;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-orange));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 15px;
}

.step-item h4 {
    color: var(--dark-grey);
    margin-bottom: 8px;
}

.step-item p {
    color: var(--medium-grey);
    font-size: 0.9rem;
}

/* Age Notice */
.age-notice {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #E8F4FC;
    padding: 25px 30px;
    border-radius: var(--border-radius);
    margin: 40px 0 20px;
    border-left: 5px solid var(--primary-blue);
}

.age-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.age-text h3 {
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.age-text p {
    color: var(--medium-grey);
}

/* Materials Notice */
.materials-notice {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #FFF9E6;
    padding: 25px 30px;
    border-radius: var(--border-radius);
    margin: 0 0 40px;
    border-left: 5px solid var(--secondary-orange);
}

.materials-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.materials-text h3 {
    color: #D4880F;
    margin-bottom: 12px;
}

.materials-text ul {
    list-style: none;
    color: var(--dark-grey);
    margin: 0;
    padding: 0;
}

.materials-text li {
    padding: 5px 0;
    padding-left: 24px;
    position: relative;
}

.materials-text li::before {
    content: "✓";
    color: var(--secondary-orange);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Pricing Card */
.pricing-card {
    background: #FFFFFF;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(27, 117, 188, 0.15);
    margin: 40px 0;
    border: 3px solid #1B75BC;
}

.price-badge {
    display: inline-block;
    background: #1B75BC;
    color: #FFFFFF;
    padding: 8px 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
}

.price {
    font-size: 4rem;
    font-weight: 800;
    color: #1B75BC;
    margin-bottom: 30px;
}

.price-features {
    list-style: none;
    margin: 0 auto 30px;
    padding: 0;
    text-align: left;
    max-width: 380px;
}

.price-features li {
    padding: 14px 0 14px 35px;
    border-bottom: 1px solid #E8E8E8;
    color: #333333;
    position: relative;
    font-size: 1rem;
}

.price-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28A745;
    font-weight: bold;
    font-size: 1.2rem;
}

.price-features li:last-child {
    border-bottom: none;
}

.btn-large {
    padding: 18px 50px;
    font-size: 1.2rem;
}

.secure-notice {
    margin-top: 20px;
    color: #666666;
    font-size: 0.9rem;
}

.parent-company {
    margin-top: 10px;
    color: #888888;
    font-size: 0.8rem;
}

/* Research Note */
.research-note {
    text-align: center;
    padding: 20px;
    color: var(--medium-grey);
    font-size: 0.9rem;
}

/* =============================================================================
   PROGRESS BAR
   ============================================================================= */

.progress-container {
    margin: 30px 0;
}

.progress-bar {
    height: 8px;
    background: var(--light-grey);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-orange));
    width: 20%;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-steps .step {
    font-size: 0.8rem;
    color: var(--medium-grey);
    font-weight: 600;
}

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

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

/* =============================================================================
   STEP CONTENT
   ============================================================================= */

.step-content {
    display: none;
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-content h2 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-size: 1.6rem;
}

.step-description {
    color: var(--medium-grey);
    margin-bottom: 25px;
}

/* =============================================================================
   INSTRUCTION CARDS
   ============================================================================= */

.instruction-card {
    background: var(--light-grey);
    padding: 20px 25px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.instruction-card h3 {
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.instruction-card p {
    color: var(--dark-grey);
    margin-bottom: 10px;
}

.instruction-card ul,
.instruction-card ol {
    margin-left: 20px;
    color: var(--dark-grey);
}

.instruction-card li {
    margin-bottom: 8px;
}

.instruction-card.highlight {
    background: #E8F4FC;
    border-left: 4px solid var(--primary-blue);
}

.instruction-card.warning {
    background: #FFF3CD;
    border-left: 4px solid var(--warning-amber);
}

.instruction-card.warning h3 {
    color: #856404;
}

.ready-check {
    margin: 30px 0;
    padding: 20px;
    background: var(--light-grey);
    border-radius: var(--border-radius);
}

.ready-check .checkbox-option {
    justify-content: center;
    background: transparent;
}

.instruction-card.info {
    background: #E8F4FC;
    border-left: 4px solid var(--primary-blue);
}

/* =============================================================================
   PAIR SECTIONS (Upload page)
   ============================================================================= */

.pair-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--light-grey);
    border-radius: var(--border-radius);
}

.pair-heading {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.upload-grid-pair {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pair-status {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: var(--medium-grey);
    background: var(--white);
    border-radius: 6px;
}

.pair-status.complete {
    color: var(--success-green);
    background: #E8F8E8;
}

.upload-summary {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    margin-top: 20px;
    border: 2px solid var(--light-grey);
}

.upload-summary p {
    font-weight: 600;
    color: var(--medium-grey);
}

.upload-summary p.success {
    color: var(--success-green);
}

.partial-notice {
    background: #FFF3CD;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--warning-amber);
    margin-bottom: 25px;
}

.partial-notice p {
    color: #856404;
    margin: 0;
}

/* =============================================================================
   FORMS
   ============================================================================= */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-grey);
}

.required {
    color: var(--error-red);
}

.field-hint {
    font-size: 0.85rem;
    color: var(--medium-grey);
    margin-bottom: 10px;
    font-weight: normal;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: var(--white);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Age Input - Improved */
.age-inputs {
    display: flex;
    gap: 30px;
}

.age-input-group {
    flex: 1;
}

.age-label {
    display: block;
    font-size: 0.9rem;
    color: var(--medium-grey);
    margin-bottom: 5px;
    font-weight: 600;
}

.age-input-group select {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    background: var(--light-grey);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.radio-option:hover,
.checkbox-option:hover {
    background: #E8F4FC;
    border-color: var(--primary-blue);
}

.radio-option input,
.checkbox-option input {
    margin-right: 10px;
    width: auto;
    cursor: pointer;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background-color: #1B75BC;
    color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
    background-color: #155a8a;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--light-grey);
    color: var(--dark-grey);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
}

/* =============================================================================
   UPLOAD CARDS
   ============================================================================= */

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.upload-card {
    background: var(--light-grey);
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-card:hover {
    border-color: var(--primary-blue);
    background: #E8F4FC;
}

.upload-card.uploaded {
    border-style: solid;
    border-color: var(--success-green);
    background: #E8F8E8;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.upload-card h3,
.upload-card h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--dark-grey);
}

.upload-card p {
    font-size: 0.85rem;
    color: var(--medium-grey);
    margin-bottom: 15px;
}

.upload-card input[type="file"] {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-blue);
    color: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s ease;
}

.upload-btn:hover {
    background: #155a8a;
}

.preview-container {
    margin-top: 15px;
}

.preview-container img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.upload-status {
    text-align: center;
    padding: 15px;
    background: var(--light-grey);
    border-radius: 8px;
    margin-top: 20px;
    font-weight: 600;
}

/* =============================================================================
   LOADING STATE
   ============================================================================= */

.loading-state {
    text-align: center;
    padding: 50px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--light-grey);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

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

.loading-state h2 {
    color: var(--primary-blue);
    margin-bottom: 15px;
}

.loading-note {
    color: var(--medium-grey);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* =============================================================================
   RESULTS STATE
   ============================================================================= */

.results-state {
    animation: fadeIn 0.5s ease;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: var(--success-green);
}

/* Score Card */
.score-card {
    display: flex;
    align-items: center;
    gap: 25px;
    background: linear-gradient(135deg, var(--primary-blue), #2E8BC0);
    color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.score-circle {
    width: 100px;
    height: 100px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.score-max {
    font-size: 1rem;
    color: var(--medium-grey);
}

.score-details h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.score-details p {
    opacity: 0.9;
}

.score-card.strong-start {
    background: linear-gradient(135deg, var(--success-green), #34C759);
}

.score-card.beginning-explorer {
    background: linear-gradient(135deg, var(--warning-amber), #FFD60A);
}

.score-card.beginning-explorer .score-details {
    color: var(--dark-grey);
}

.score-card.early-days {
    background: linear-gradient(135deg, var(--info-blue), #5AC8FA);
}

/* Breakdown */
.results-breakdown {
    margin-bottom: 30px;
}

.results-breakdown h3 {
    margin-bottom: 20px;
    color: var(--dark-grey);
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.breakdown-label {
    flex: 0 0 180px;
    font-size: 0.9rem;
    color: var(--medium-grey);
}

.breakdown-bar {
    flex: 1;
    height: 12px;
    background: var(--light-grey);
    border-radius: 6px;
    overflow: hidden;
}

.breakdown-fill {
    height: 100%;
    background: var(--primary-blue);
    border-radius: 6px;
    transition: width 1s ease;
}

.breakdown-score {
    flex: 0 0 50px;
    text-align: right;
    font-weight: 600;
    color: var(--dark-grey);
}

/* Observations */
.observations-section,
.insights-section {
    background: var(--light-grey);
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
}

.observations-section h3,
.insights-section h3 {
    margin-bottom: 15px;
    color: var(--dark-grey);
}

.observation-item,
.insight-item {
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

.observation-item:last-child,
.insight-item:last-child {
    border-bottom: none;
}

.observation-label {
    font-weight: 600;
    color: var(--primary-blue);
    display: block;
    margin-bottom: 5px;
}

/* Email Confirmation */
.email-confirmation {
    text-align: center;
    padding: 30px;
    background: #E8F8E8;
    border-radius: var(--border-radius);
    margin: 30px 0;
}

.email-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.email-note {
    font-size: 0.9rem;
    color: var(--medium-grey);
    margin-top: 10px;
}

/* =============================================================================
   ERROR STATE
   ============================================================================= */

.error-state {
    text-align: center;
    padding: 50px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-state h2 {
    color: var(--error-red);
    margin-bottom: 15px;
}

.error-options {
    margin: 25px 0;
}

.error-options .btn {
    margin: 15px 0;
}

.error-contact {
    margin-top: 30px;
    padding: 20px;
    background: var(--light-grey);
    border-radius: var(--border-radius);
    text-align: center;
}

.error-contact a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.error-contact a:hover {
    text-decoration: underline;
}

.error-note {
    font-size: 0.9rem;
    color: var(--medium-grey);
    margin-top: 10px;
}

/* =============================================================================
   FOOTER
   ============================================================================= */

.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--medium-grey);
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 3rem;
    }
    
    .age-notice,
    .materials-notice {
        flex-direction: column;
        align-items: center;
    }
    
    .age-icon,
    .materials-icon {
        text-align: center;
    }
    
    .age-text,
    .materials-text {
        width: 100%;
    }
    
    .age-text h3,
    .materials-text h3 {
        text-align: center;
    }
    
    .age-text p {
        text-align: center;
    }
    
    .materials-text ul {
        text-align: left;
    }
    
    .progress-steps .step {
        font-size: 0.7rem;
    }
}

@media (max-width: 600px) {
    .step-content {
        padding: 20px;
    }
    
    .age-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .upload-grid,
    .upload-grid-pair {
        grid-template-columns: 1fr;
    }
    
    .score-card {
        flex-direction: column;
        text-align: center;
    }
    
    .breakdown-item {
        flex-wrap: wrap;
    }
    
    .breakdown-label {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
