/* Form Elements Styling */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
    color: #666;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #585858;
    border-radius: 4px;
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 3px rgba(26, 115, 232, 0.3);
}

/* Form Row for two columns */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Radio Button Styling */
.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn-prev,
.btn-next,
.btn-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-prev {
    background-color: #6c757d;
    color: #ffffff;
}

.btn-next,
.btn-submit {
    background-color: #1a73e8;
    color: #ffffff;
}

.btn-prev:hover,
.btn-next:hover,
.btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Country Dropdown Styling */
select[name="country"],
select[name="guardian_country"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #585858;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    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'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select[name="country"]:focus,
select[name="guardian_country"]:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

select[name="country"] optgroup,
select[name="guardian_country"] optgroup {
    font-weight: bold;
    color: #1a73e8;
    background-color: #f5f7fa;
}

select[name="country"] option,
select[name="guardian_country"] option {
    padding: 8px;
    font-weight: normal;
    color: #333;
}

select[name="nationality"],
select[name="guardian_nationality"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #585858;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    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'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select[name="nationality"]:focus,
select[name="guardian_nationality"]:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Highlight active optgroup for better visual hierarchy */
select[name="nationality"] optgroup,
select[name="guardian_nationality"] optgroup {
    font-weight: bold;
    color: #1a73e8;
    background-color: #f5f7fa;
}

/* Style individual options */
select[name="nationality"] option,
select[name="guardian_nationality"] option {
    padding: 8px;
    font-weight: normal;
    color: #333;
}

/* Consistent dropdown styling across all selects */
select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Form validation styles */
input.invalid,
select.invalid,
textarea.invalid {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    padding-left: 5px;
}

/* Submit button styles */
.btn-submit {
    position: relative;
    transition: all 0.3s ease;
}

.btn-submit.submitting {
    padding-left: 30px;
    opacity: 0.7;
}

.btn-submit.submitting::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Dropdown styling enhancement */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem !important;
}

/* Ensure select options are properly visible */
select option {
    background-color: white;
    color: #333;
    padding: 5px;
}

/* Checkbox and radio button improvements */
input[type="radio"],
input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px;
}

.radio-group label,
.checkbox-group label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
}

/* Date input styling */
input[type="date"] {
    min-height: 42px;
}