/* for form.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7f6; /* Consistent background for both pages */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    /* Padding is handled conditionally below */
}

/* Form Container */
.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

/* Add padding to body only for the form page, not the chooser page */
body:has(.container) {
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1c1e21;
    font-weight: 600;
}


/* --- Form Page Styles (form.html) --- */

/* Input Groups */
.input-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
    color: #606770;
}

label i {
    margin-right: 8px;
    color: #1877f2;
    width: 16px;
    text-align: center;
}

.required-asterisk {
    color: #fa383e; /* Error color */
    margin-left: 5px;
}

input,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

/* Error States */
.input-group.error input,
.input-group.error textarea {
    border-color: #fa383e;
}

.error-message {
    color: #fa383e;
    font-size: 13px;
    display: none; /* Hidden by default */
    margin-top: 5px;
}

.input-group.error .error-message {
    display: block; /* Shown when there's an error */
}

/* Message Field Specifics */
textarea {
    resize: vertical;
    min-height: 100px;
}

.website-field {
    position: absolute;
    left: -5000px;
    top: -5000px;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #606770;
    margin-top: 5px;
}

/* Submit Button */
button[type="submit"] {
    width: 100%;
    min-height: 54px; /* Maintain height during loading */
    background-color: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

button[type="submit"]:hover {
    background-color: #166fe5;
}

/* Spinner for loading state */
.spinner {
    display: none; /* Hidden by default */
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

button[type="submit"].loading .spinner {
    display: block;
}

button[type="submit"].loading .button-text {
    display: none;
}

button[type="submit"].loading {
    cursor: wait;
}

/* Success Message State */
#successMessage {
    text-align: center;
    padding: 20px 0;
}

#successMessage i {
    font-size: 60px;
    color: #28a745; /* A success green color */
    margin-bottom: 20px;
}

#successMessage h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #1c1e21;
}

#successMessage p {
    color: #606770;
    margin-bottom: 30px;
}

#successMessage button {
    width: auto;
    padding: 12px 30px;
    background-color: #1877f2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

#successMessage button:hover {
    background-color: #166fe5;
}

/* Mobile Friendliness / Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }
}

 /* for index.html */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f7f6;
    font-family: 'Poppins', sans-serif;
}

/* Main Container */
.chooser-container {
    text-align: center;
    background: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

/* Heading */
.chooser-container h1 {
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
}

/* Option Box Styles */
.option-box {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 16px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    justify-content: space-between; /* Push content and checkmark apart */
    position: relative;
}

.option-box:hover {
    border-color: #007bff;
}

/* Hide the actual radio button */
.option-box input[type="radio"] {
    display: none;
}

/* Custom radio button indicator */
.option-box::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0; /* Prevent the circle from shrinking */
    margin-left: 15px; /* Space between text and circle */
    /* Default state with a light gray checkmark */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23ccc' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
}

/* Style for the selected indicator */
.option-box.selected::after {
    background-color: #007bff;
    border-color: #007bff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 50%;
}


/* Style for the selected option box's title */
.option-box.selected .option-content h2 {
        color: #007bff;
}

/* Style for the selected option box */
.option-box.selected {
    border-color: #007bff;
    background-color: #f8f9fa;
}

/* Content inside the box */
.option-content h2 {
    margin: 0 0 5px 0;
    transition: color 0.3s; /* Smooth color transition */
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.option-content p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.next-button {
    padding: 15px;
    font-size: 1em;
    font-weight: 500;
    flex-grow: 1;
    flex-basis: 0;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.back-button {
    flex-grow: 1;
    flex-basis: 0;
    background-color: #f0f2f5;
    color: #606770;
    border: none;
    border-radius: 6px;
    padding: 15px;
    font-size: 1em;
    font-weight: 600;
}

.back-button:hover {
    background-color: #e4e6e9;
    border-color: #ccc;
    color: #333;
}

/* Language Selection Button Styles */
.lang-button {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #007bff;
    border-radius: 5px;
    background-color: #fff;
    color: #007bff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.lang-button:hover {
    background-color: #e9f2ff;
    border-color: #0056b3;
}
.lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

/* Error message for the chooser */
.chooser-error {
    color: #fa383e; /* Using the same error red from style.css */
    font-size: 14px;
    margin-top: 15px;
    min-height: 20px; /* Prevents layout shift */
}

/* Responsive adjustments for mobile */
@media (max-width: 576px) {
    .chooser-container {
        padding: 25px 16px; /* Adjust padding for smaller screens */
        width: 100%; /* Make it full width */
        border-radius: 0; /* Remove border-radius for a full-screen feel */
    }
    /* On chooser page, remove body padding on mobile */
    body:has(#language-selector) {
        padding: 0;
    }
    /* On form page, remove body padding on mobile */
    body:has(.container) {
        padding: 0;
    }
}