/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors - Malvern Garden Buildings */
    --primary-green: #10413e;
    --primary-green-light: #1a5d58;
    --primary-green-dark: #0a2d2a;
    --accent-green: #2a7a73;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6b6b6b;
    --background-light: #f8f9f6;
    --background-white: #ffffff;
    --background-light-green: #e8f0e3;
    --background-warning: #fff3cd;
    --background-info: #f8f9f6;
    --background-grey: #ededed;
    --border-color: #e0e0e0;
    --success-color: #10413e;
    --success-bg: #e8f0e3;
    --warning-color: #d97706;
    --warning-bg: #fef3c7;
    --error-color: #dc2626;
    --error-bg: #fee2e2;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --gradient-bg: #fafafa;
    --gradient-primary: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    --gradient-primary-hover: linear-gradient(135deg, var(--primary-green-dark) 0%, var(--primary-green) 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-dark);
    background: var(--gradient-bg);
    line-height: 1.6;
    min-height: 100vh;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -42px;
    left: 0;
    background: var(--primary-green);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Fieldset Styles */
.options-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.options-fieldset legend {
    margin-bottom: 0;
}

/* Heading Styles - Playfair Display */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary-green);
}

.question-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary-green);
}

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

/* Header Styles */
.header {
    background: var(--background-grey);
    width: 100%;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

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

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

.header-logo {
    width: 2em;
    height: auto;
    flex-shrink: 0;
}

.header-logo svg {
    width: 100%;
    height: auto;
}

.header-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-green);
    color: var(--background-white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.header-button:hover {
    background: var(--primary-green-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Quiz Intro Section */
.quiz-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-intro h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    color: var(--primary-green);
}

.quiz-intro .subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-medium);
}

/* Main Content */
.main-content {
    background: var(--background-white);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Quiz Container */
.quiz-container {
    min-height: 400px;
}

/* Question Styles */
.question-container {
    display: none;
    animation: fadeIn 0.3s ease;
}

.question-container.active {
    display: block;
}

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

.question-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.question-help {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* Option Styles */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: 500;
}

.option-label:hover {
    background: #f0f2ed;
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.option-label input[type="radio"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-green);
    flex-shrink: 0;
}

.option-label input[type="radio"]:focus {
    outline: none;
}

.option-label input[type="radio"]:checked + .option-text {
    color: var(--primary-green);
    font-weight: 600;
}

.option-label:has(input[type="radio"]:checked) {
    background: var(--background-light-green);
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 65, 62, 0.1);
}

.option-text {
    flex: 1;
    color: var(--text-dark);
}

/* Number Input Styles */
.number-input-container {
    margin-top: 1rem;
}

.number-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-white);
    transition: all 0.2s ease;
    font-family: inherit;
}

.number-input:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 65, 62, 0.1);
}

.input-unit {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Dimensions Container (for length and width together) */
.dimensions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dimension-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dimension-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.dimension-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dimension-input {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.dimension-unit {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-weight: 500;
    white-space: nowrap;
}

.dimension-help {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.25rem;
}

.dimension-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-light-green);
    border-radius: 8px;
    text-align: center;
    color: var(--primary-green);
    font-weight: 600;
}

/* Button Styles */
.btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: var(--background-white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
    background: var(--background-light);
    transform: translateY(-2px);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    gap: 1rem;
}

/* Result Container */
.result-container {
    text-align: center;
}

.result-content {
    max-width: 600px;
    margin: 0 auto;
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.result-icon.success {
    background: var(--success-bg);
    color: var(--success-color);
}

.result-icon.warning {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.result-icon.error {
    background: var(--error-bg);
    color: var(--error-color);
}

/* Result message styles */
.result-warning-box {
    background: var(--background-warning);
    border-left: 4px solid var(--warning-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: left;
}

.result-info-box {
    background: var(--background-info);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: left;
}

.result-success-box {
    background: var(--success-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: left;
}

.result-link {
    color: var(--primary-green);
    text-decoration: underline;
}

.result-link:hover {
    color: var(--primary-green-dark);
}

#resultTitle {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

#resultMessage {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    width: 100%;
    background: var(--background-grey);
    text-align: center;
    padding: 2rem 0;
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.footer > p {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
}

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

.disclaimer {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 0;
    }

    .header-logo {
        width: 50px;
    }

    .header-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .quiz-intro h1 {
        font-size: 2rem;
    }

    .quiz-intro .subtitle {
        font-size: 1rem;
    }

    .dimension-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .dimension-input {
        max-width: 100%;
    }

    .dimension-unit {
        align-self: flex-start;
    }

    .main-content {
        padding: 1.5rem;
    }

    .question-title {
        font-size: 1.25rem;
    }

    .quiz-navigation {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }
}

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

    .header {
        padding: 1.25rem 0;
    }

    .header-container {
        padding: 0 15px;
    }

    .header-logo {
        width: 45px;
    }

    .main-content {
        padding: 1.25rem;
    }

    .result-container {
        padding: 2rem 1.5rem;
    }
}

