/* /assets/css/forms.css (Final Consolidated Version - Updated for new fields) */

/* --- 1. Form Page Body & Layout --- */
.form-page-body {
    background-color: var(--primary-blue); /* Assuming this is defined in style.css or a global root */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}
body[dir="rtl"] .form-page-body {
    font-family: 'Cairo', sans-serif;
}

.form-page-header {
    margin-bottom: 2rem;
    flex-shrink: 0;
}
.form-page-header img {
    height: 50px;
    width: auto;
}
.form-container-wrapper {
    width: 100%;
    max-width: 480px;
    padding: 0;
}

/* --- 2. Main Form Box --- */
.form-box {
    background: #ffffff;
    padding: 2.5rem 3rem;
    border-radius: var(--border-radius); /* Assuming border-radius is defined in style.css */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}
.form-header h2 {
    color: var(--primary-blue);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
}
.form-header p {
    color: var(--muted-text);
    font-size: 1rem;
    margin: 0;
}

/* --- 3. Input Groups and Labels --- */
.input-group {
    margin-bottom: 1.5rem;
}
.input-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
    text-align: left;
}
body[dir="rtl"] .input-group label {
    text-align: right;
}
.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="tel"], /* NEW: Added for phone number */
.input-group select { /* For country dropdown */
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all var(--transition-speed);
    box-sizing: border-box;
    color: var(--dark-text);
    background-color: #fefefe;
}
.input-group input::placeholder {
    color: #adb5bd;
    font-style: italic;
}
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--secondary-yellow);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.3);
}

/* --- 4. Custom Radio/Checkbox & Form Options (FIXED) --- */

.radio-group, .terms-group {
    text-align: left;
    padding-top: 5px;
}
body[dir="rtl"] .radio-group,
body[dir="rtl"] .terms-group {
    text-align: right;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--dark-text);
    font-size: 0.95rem;
}

.radio-label input, .checkbox-label input {
    display: none;
}

.radio-custom, .checkbox-custom {
    display: inline-block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #ced4da;
    margin-right: 12px;
    transition: all var(--transition-speed);
    position: relative;
}
body[dir="rtl"] .radio-custom,
body[dir="rtl"] .checkbox-custom {
    margin-right: 0;
    margin-left: 12px;
}

.radio-custom { border-radius: 50%; }
.checkbox-custom { border-radius: 4px; }

.radio-label input:checked + .radio-custom {
    border-color: var(--primary-blue);
}
.radio-label input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-blue);
}
.checkbox-label input:checked + .checkbox-custom {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--muted-text);
}
body[dir="rtl"] .form-options { flex-direction: row-reverse; }
.form-options a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-speed);
}
.form-options a:hover {
    color: var(--secondary-yellow);
}


/* --- 5. Form Button and Footer --- */
.form-button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-blue);
    background-color: var(--secondary-yellow);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}
.form-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 196, 0, 0.4);
}
.form-button:disabled {
    background-color: #cccccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--muted-text);
    font-size: 0.95rem;
}
.form-footer a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-speed);
}
.form-footer a:hover {
    color: var(--secondary-yellow);
}


/* --- 6. Form Alert Messages (Flash Messages) --- */
.form-alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
}
.form-alert.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.form-alert.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}


/* --- 7. Universal Client-Side Validation Styles --- */

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 8px;
    font-weight: 500;
    text-align: left;
    display: none; /* Hidden by default by JS */
}
body[dir="rtl"] .error-message { text-align: right; }

.input-group.error input,
.input-group.error select { /* Apply to both input and select */
    border-color: #dc3545 !important;
}
.input-group.error .error-message {
    display: block; /* Show error message when input-group has 'error' class */
}
/* For checkboxes/radios, the error message itself is enough, no border on custom element */
.input-group.error .checkbox-custom,
.input-group.error .radio-custom {
    border-color: #dc3545;
}

/* Styling for the new Coupon Code field in pricing cards */


.form-input-coupon {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-input);
    font-size: 0.95rem;
    box-sizing: border-box; /* Important */
    text-align: center;
    background-color: #f8f9fa;
}

.form-input-coupon:focus {
    outline: none;
    border-color: var(--secondary-yellow);
    box-shadow: 0 0 0 2px rgba(255, 196, 0, 0.3);
}