/* Box sizing for easier sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* CSS Variables for brand colors */
:root {
    --brand-color: #843816;
    --brand-color-dark: #6a2f13;
    --text-color: #333333;
    --text-color-light: #666666;
    --bg-color: #fafafa;
    --input-border: #ccc;
    --input-focus: #843816;
    --button-hover: #a14c2a;
}

/* Base styles */
body {
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

html {
    scroll-behavior: smooth;
}

/* Header */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 24px 0;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.05);
}

.header-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    height: 60px;
    width: auto;
}

.header-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--brand-color);
    margin: 0;
    letter-spacing: 0.02em;
}

/* Main container */
.main-container {
    max-width: 700px;
    margin: 48px auto;
    padding: 0 20px;
    flex-grow: 1;
}

/* Intro section */
.intro h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 14px;
    letter-spacing: 0.01em;
}

.intro p {
    font-size: 16px;
    color: var(--text-color-light);
    margin-bottom: 1.25em;
}

.intro h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--brand-color);
    margin-top: 2.5em;
}

/* Form */
.form {
    margin-top: 2.5em;
}

.form-group {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 0px;
    color: #5a3b20;
    font-size: 15px;
}

.input-help-text {
    font-size: 13px;
    color: var(--text-color-light);
    margin-top: 6px;
    margin-bottom: 16px;
    font-style: italic;
}

/* Inputs */
input[type="text"],
input[type="tel"] {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    border: 1.8px solid var(--input-border);
    max-width: 100%;
    background-color: #fff;
    box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

input::placeholder {
    color: var(--text-color-light);
    font-style: italic;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

input:focus::placeholder {
    opacity: 0.4;
}

input[type="text"]:focus,
input[type="tel"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 6px rgba(132, 56, 22, 0.4);
    background-color: #fff6f2;
    outline: 3px solid var(--button-hover);
    outline-offset: 2px;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    white-space: nowrap;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-color);
    cursor: pointer;
}

.radio-option input[type="radio"]:focus {
    outline: 3px solid var(--button-hover);
    outline-offset: 2px;
}

/* Fieldsets for grouping */
fieldset {
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

legend {
    font-weight: 600;
    color: var(--brand-color);
    padding: 0 8px;
}

/* Form actions */
.form-actions {
    margin-top: 36px;
}

.button {
    background-color: var(--brand-color);
    color: white;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 10px rgb(132 56 22 / 0.3);
    width: 100%;
}

.button:hover,
.button:focus {
    background-color: var(--button-hover);
    box-shadow: 0 6px 14px rgb(161 76 42 / 0.5);
    outline: none;
}

/* Footer */
.footer {
    background-color: #333;
    color: #e5e5e5;
    padding: 24px 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer a {
    color: #e5e5e5;
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s ease;
}

.footer a:hover,
.footer a:focus {
    text-decoration: underline;
    color: #f5cba7;
    outline: none;
}

/* Form error styling */
.form-error-message {
    color: #b92c00;
    background-color: #fdecea;
    border: 1px solid #f5c6cb;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    margin-top: 6px;
    animation: fadeInError 0.3s ease-in-out;
    box-shadow: 0 1px 4px rgba(185, 44, 0, 0.15);
}

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

.input-error {
    border-color: #b92c00 !important;
    box-shadow: 0 0 6px rgba(185, 44, 0, 0.4) !important;
    background-color: #fff9f8;
}

.form-group.has-error label {
    color: #b92c00;
}

/* Success message styling */
.message-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 15px;
    line-height: 1.65;
    margin-top: 32px;
    margin-bottom: 32px;
    max-width: 680px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: fadeInBox 0.35s ease-in-out;
    transition: all 0.3s ease;
}

.message-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 4px;
}

.message-content h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-color-dark);
}

.message-content p {
    margin: 0 0 6px 0;
}

.success-message {
    background: linear-gradient(145deg, #e7f6ee, #f1fcf7);
    border-left: 6px solid #5cbf8a;
    color: #255d42;
}

.error-message {
    background: linear-gradient(145deg, #fff1f0, #fdecea);
    border-left: 6px solid #e66464;
    color: #842029;
}

.not-eligible-message {
    background: linear-gradient(145deg, #fff1f0, #fdecea);
    border-left: 6px solid #e66464;
    color: #842029;
}

.back-to-form {
    margin-top: 18px;
    background-color: transparent;
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.back-to-form:hover,
.back-to-form:focus {
    background-color: var(--brand-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(132, 56, 22, 0.3);
    outline: none;
}

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

/* Responsive */
@media screen and (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .header-title {
        font-size: 22px;
        text-align: center;
    }

    .main-container {
        padding: 0 15px;
        margin: 32px auto;
    }

    .radio-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px 24px;
    }

    .form-group input[type="text"],
    .form-group input[type="tel"] {
        width: 100%;
    }

    .form {
        max-width: 100%;
    }
}
