body {
    font-family: sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fff; /* Set background to white */
}

.container {
    text-align: center;
    padding: 20px 0; /* Remove horizontal padding, keep vertical */
    max-width: 700px; /* Constrain overall width */
    margin: auto; /* Center container */
}

/* Create a wrapper for the title to match step container */
h1 {
    margin: 0 auto 10px; /* Center horizontally with auto margins */
    color: #000; /* Set heading color to black */
    max-width: 550px; /* Match exactly the step width */
    line-height: 1.3; /* Improve line spacing */
    font-size: 2rem; /* Base font size */
    text-align: left; /* Align text to the left */
    padding-left: 10px; /* Match the padding of step h2 */
    padding-right: 10px;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
    width: 100%; /* Take full width of its container */
}

.subtitle {
    color: #555;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 30px;
    font-style: italic;
    max-width: 530px; /* Match the h1 width */
    text-align: left; /* Align text to the left */
    padding-left: 10px; /* Match the padding of step h2 */
    padding-right: 10px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
}

.progress-container {
    width: 100%;
    height: 4px;
    background-color: #f0f0f0;
    margin: 15px auto;
    border-radius: 2px;
    overflow: hidden;
    display: block; /* Ensure visibility */
    max-width: 500px; /* Match content width */
}

.progress-bar {
    height: 100%;
    background-color: #000;
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9em;
    color: #777;
    margin-top: 5px;
    text-align: center;
}

@media (max-width: 480px) {
    .progress-container {
        margin: 15px auto;
        height: 3px;
    }
}

.step {
    display: none;
    text-align: left;
    max-width: 550px; /* Consistent width for all step content */
    margin: 20px auto; /* Reduced vertical margin */
    padding: 0; /* Remove padding that causes misalignment */
}

.step.active {
    display: block;
}

.step h2 {
    color: #000; /* Black question titles */
    margin-bottom: 16px; /* Further reduced space below question */
    font-size: 1.8em; /* Larger question font */
    font-weight: normal;
    line-height: 1.4;
    padding: 0 10px; /* Add horizontal padding to the heading */
}

.step p {
    color: #000; /* Black descriptions */
    margin-bottom: 28px; /* Further reduced space below description */
    font-size: 1.2em; /* Slightly larger description */
    line-height: 1.5;
    padding: 0 10px; /* Add padding to align with heading */
}

.step label {
    display: block;
    margin-bottom: 10px; /* Reduced space for labels */
    color: #000;
    font-size: 1.2em; /* Slightly larger label */
    padding: 0 10px; /* Align with question title */
    box-sizing: border-box;
}

.step input[type="radio"],
.step input[type="checkbox"] {
    margin-left: 10px; /* Align with label text */
}

.step input[type="text"],
.step input[type="email"],
.step input[type="number"],
.step textarea {
    width: calc(100% - 20px);
    padding: 10px 5px; /* Adjusted vertical padding */
    margin: 0 10px 28px; /* Further reduced space below input */
    border: none;
    border-bottom: 1px solid #000; /* Black underline */
    box-sizing: border-box;
    font-size: 1.5em; /* Larger input font */
}

.step textarea {
    resize: vertical; /* Allow vertical resizing */
    min-height: 100px; /* Ensure enough space for content */
    padding: 10px 10px;
}

.step textarea::placeholder {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .step textarea::placeholder {
        font-size: 0.85em;
    }
}

.step select {
    width: calc(100% - 20px); /* Adjust width to account for padding */
    padding: 10px 5px; /* Adjusted vertical padding */
    margin: 0 10px 28px; /* Add left/right margin to align with headers */
    border: 1px solid #000;
    box-sizing: border-box;
    font-size: 1.5em; /* Larger select font */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
    cursor: pointer;
}

.navigation {
    text-align: left;
    margin-top: 30px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

.button-container {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding-left: 5px; /* Only here, to match .step h2 and fields */
    margin-left: 0;
}

.enter-hint {
    color: #666;
    font-size: 0.9em;
    opacity: 0.8;
    font-style: italic;
}

.navigation button {
    position: relative;
    background-color: #000;
    color: white;
    border: none;
    padding: 8px 18px; /* Adjust button padding */
    font-size: 1em;
    border-radius: 4px; /* Slightly smaller radius */
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.2s ease;
}

.navigation button:disabled {
    background-color: #666;
    cursor: not-allowed;
}

/* Required field styling */
.required {
    color: #e32;
    display: none; /* Hide by default */
    margin-left: 3px;
}

.required.show-required {
    display: inline-block; /* Only show when validation fails */
}

.required-message {
    color: #e32;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
    display: none !important; /* Hide by default */
}

.error-message {
    color: #e32;
    font-size: 0.9em;
    margin-top: 5px;
    min-height: 18px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.2s linear;
}

.error-message.show-error {
    visibility: visible;
    opacity: 1;
    font-weight: bold;
    background-color: #fff0f0;
    padding: 5px 10px;
    border-left: 3px solid #e32;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

input.error, textarea.error {
    border: 1px solid #e32;
    background-color: #fff0f0;
}

/* Responsive layout */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px;
    }

    .navigation button {
        width: auto;
        margin: 5px;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 480px) {
    /* Container adjustments */
    .container {
        width: 100%;
        padding: 15px;
        margin: 0;
    }

    /* Typography scaling */
    h1 {
        font-size: 1.6em;
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 1em;
        margin-bottom: 20px;
    }
    
    .step h2 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }

    .step p {
        font-size: 1.1em;
        margin-bottom: 20px;
    }

    /* Form elements */
    .step input[type="text"],
    .step input[type="email"],
    .step input[type="number"],
    .step textarea,
    .step select {
        font-size: 16px;
        padding: 12px 8px;
        margin-bottom: 20px;
    }

    .step select {
        padding-right: 35px;
        background-position: right 10px center;
    }

    /* Navigation */
    .navigation button {
        padding: 12px 24px;
        font-size: 1.1em;
        width: 100%;
        margin: 10px 0;
    }

    /* Improved touch targets */
    .step label {
        padding: 8px 0;
        margin: 5px 0;
        font-size: 1.1em;
    }

    /* Error messages */
    .error-message {
        font-size: 0.9em;
        padding: 8px;
        margin: 5px 0 15px;
    }

    /* Email reminder adjustments */
    .email-reminder {
        padding: 10px;
        margin: 8px 0;
    }

    .email-reminder p {
        font-size: 0.9em;
    }

    .copy-btn {
        width: 100%;
        margin-top: 8px;
        padding: 10px;
    }

    /* Two-column grid adjustments */
    .two-column-grid {
        gap: 15px;
    }

    .compact-other-field {
        margin-top: -10px;
        padding: 10px;
    }
}

/* Video container styles */
.video-container {
    position: relative;
    width: 100%;
    max-width: 530px; /* Reduced to match content width */
    margin: 0 auto 28px;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 480px) {
    .video-container {
        margin-bottom: 20px;
    }
}

/* Two-column layout for industry and occupation fields */
.two-column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.two-column-grid .field-group {
    width: 100%;
}

.two-column-grid select {
    margin-bottom: 15px;
}

@media (max-width: 600px) {
    .two-column-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Compact version of other field container */
.compact-other-field {
    margin-top: -15px;
    margin-bottom: 15px;
    padding: 8px 10px;
    border-left: 3px solid #007bff;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.compact-other-field label {
    font-size: 0.9em;
    margin-bottom: 3px;
}

.compact-other-field input {
    margin-bottom: 0;
    font-size: 1.2em;
    padding: 8px 5px;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Thank You Page Styles */
.thank-you-split-container {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

.thank-you-image-column {
    flex: 1;
    max-width: 50%;
    padding-right: 15px;
}

.thank-you-image-column img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
}

.thank-you-content-column {
    flex: 1;
    max-width: 50%;
    padding-left: 15px;
}

.thank-you-content {
    max-width: 500px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .thank-you-split-container {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        margin: 10px auto;
    }

    .thank-you-image-column,
    .thank-you-content-column {
        max-width: 100%;
        padding: 0;
    }

    .thank-you-content {
        padding: 0 10px;
    }

    .thank-you-content h1 {
        font-size: 1.6em;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .thank-you-split-container {
        gap: 15px;
        padding: 10px;
    }

    .countdown-container {
        margin: 20px 0;
        padding: 12px;
    }

    #countdown {
        font-size: 1.3em;
    }

    .cta-section {
        margin-top: 20px;
    }

    .primary-button {
        width: 100%;
        padding: 14px 20px;
    }

    .checkmark {
        width: 60px;
        height: 60px;
    }
}

.thank-you-content h1 {
    color: #000;
    margin-bottom: 30px;
}

.thank-you-content p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Countdown styles */
.countdown-container {
    margin: 30px 0;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f8f8;
    border: 1px solid #eee;
}

#countdown {
    font-size: 1.5em;
    font-weight: bold;
    color: #000;
}

.progress-bar-container {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #000;
    width: 0;
    transition: width 1s linear;
    border-radius: 3px;
}

.small-text {
    font-size: 0.9em;
    color: #777;
    margin-top: 10px;
}

/* Button styling */
.cta-section {
    margin-top: 25px;
}

.primary-button {
    background-color: #000;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.primary-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.checkmark-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #000;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: #000;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

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

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #000;
    }
}

/* Email reminder styling */
.email-reminder {
    margin: 10px 0 15px;
    padding: 12px;
    background-color: #fffbf0;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

.email-reminder p {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 0.95em;
}

.copy-btn {
    background-color: #ffc107;
    color: #000;
    border: none;
    padding: 6px 12px;
    font-size: 0.9em;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background-color: #e0a800;
    transform: translateY(-1px);
}

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

.copy-btn.copied {
    background-color: #28a745;
    color: white;
}

/* Restored message styling */
.restored-message {
    background-color: #d4edda;
    color: #155724;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.5s ease-in;
    transition: opacity 0.5s ease-out;
}

.restored-message.hiding {
    opacity: 0;
}

.restored-message p {
    margin: 0;
    font-weight: 500;
}

.secondary-button {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.secondary-button:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

/* Styles for the Material Link Button */
.material-button {
    display: inline-block;
    background-color: #dc3545; /* Red color */
    color: white;
    padding: 12px 25px;
    font-size: 1.2em; /* Larger font size */
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px; /* Add some space above */
    text-align: center;
}

.material-button:hover {
    background-color: #c82333; /* Darker red on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.material-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Styles for the emphasized warning */
.warning-emphasis {
    font-size: 1.15em; /* Slightly larger font */
    color: #856404; /* Dark yellow/brown color */
    background-color: #fff3cd; /* Light yellow background */
    border-left: 4px solid #ffc107; /* Yellow left border */
    padding: 10px 15px;
    margin-bottom: 15px !important; /* Ensure spacing, override default p margin if needed */
    border-radius: 4px;
}

.warning-emphasis strong {
    color: #721c24; /* Darker red for the 'Important' text */
}
