/* ===================================================================
 * File: assets/css/register.css
 * Description: Styles for the multi-step user registration process.
 * Author: Gemini
 * =================================================================== */

/* --- Root Variables (for consistency with your site) --- */
:root {
    --primary-color: #8B0000;
    --success-color: #28a745;
    --secondary-color: #6c757d;
    --border-color: #ddd;
    --light-bg: #f8f4ef;
    --white: #fff;
    --label-color: #333;
    --light-text-color: #666;
    --disabled-bg: #e9ecef;
}

/* --- General Body and Layout --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    line-height: 1.6;
    color: var(--label-color);
    padding: 15px; /* Padding for small screens */
    margin: 0;
}

.container {
    max-width: 600px;
    margin: 20px auto;
    background-color: var(--white);
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* --- Registration Header --- */
h3 {
    text-align: center;
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-weight: 600;
    font-size: 1.8em;
}

.container > p {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--light-text-color);
}

/* --- Progress Bar --- */
.progress-bar-container {
    width: 100%;
    margin-bottom: 35px;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-bar-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 3px;
    width: 100%;
    background-color: var(--border-color);
    z-index: 1;
}

.progress-bar {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 3px;
    background-color: var(--success-color);
    z-index: 2;
    width: 0%; /* Will be controlled by step classes */
    transition: width 0.4s ease;
}

/* Progress bar width based on current step */
.step-2 .progress-bar { width: 33%; }
.step-3 .progress-bar { width: 66%; }
.step-4 .progress-bar { width: 100%; }

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    text-align: center;
}

.step-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--white);
    border: 3px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--light-text-color);
    transition: all 0.4s ease;
}

.step-label {
    font-size: 0.8em;
    margin-top: 8px;
    color: var(--light-text-color);
    font-weight: 500;
}

/* Styling for active and completed steps */
.step.active .step-icon {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white);
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.step.completed .step-icon {
    border-color: var(--success-color);
    background-color: var(--success-color);
    color: var(--white);
}
.step.completed .step-icon::before {
    content: '✓'; /* Checkmark for completed steps */
    font-size: 1.2em;
}

/* --- Form Element Styling --- */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--label-color);
}

/* Style for the red asterisk */
label span {
    color: var(--primary-color);
    font-weight: bold;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="password"],
select,
textarea,
input:read-only { /* Added readonly input for the 'Age' field */
    width: 100%;
    padding: 12px; /* Standardized padding */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    background-color: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* This is the key for consistent sizing */
    line-height: 1.5; /* Improves vertical alignment */
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}

/* Style for disabled/readonly fields */
input:read-only,
select:disabled {
    background-color: var(--disabled-bg);
    cursor: not-allowed;
    border-color: #e0e0e0;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

#aboutCharCounter {
    text-align: right;
    font-size: 0.85em;
    color: var(--light-text-color);
    margin-top: 5px;
}

/* Custom Select Arrow */
select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23555" 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 12px center;
    background-size: 18px;
}

/* --- Custom Multi-Select for Languages (from edit_profile_styles.css) --- */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    background-color: var(--white);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.custom-select-trigger:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}
.custom-select-trigger .arrow {
    transition: transform 0.3s ease;
}
.custom-select-trigger.active .arrow {
    transform: rotate(180deg);
}
.custom-options {
    display: none;
    position: absolute;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--white);
    z-index: 99;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 5px;
}
.custom-options.show {
    display: block;
}
.custom-option {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.custom-option:hover {
    background-color: #f9f0f0;
}
.custom-option input[type="checkbox"] {
    width: auto;
    margin-right: 12px;
    transform: scale(1.1);
}
.custom-option label {
    margin-bottom: 0;
    font-weight: normal;
}


/* --- Form Buttons --- */
.form-buttons {
    display: flex; /* Using Flexbox for layout */
    gap: 15px;
    margin-top: 30px;
}

.btn-submit, .btn-secondary {
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    flex: 1; /* This is the key: forces both buttons to be equal width */
}

.btn-submit {
    background-color: var(--success-color);
    color: var(--white);
    border: 1px solid var(--success-color); /* Added for consistency */
    order: 2; /* Add this line */
}
.btn-submit:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    order: 1; /* Add this line */
}
.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}
/* --- Message/Error Styling --- */
.message {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
}
.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Responsive Adjustments --- */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    .container {
        padding: 20px 15px;
        margin: 10px auto;
    }
    h3 {
        font-size: 1.5em;
    }
    .step-label {
        display: none; /* Hide labels on very small screens to save space */
    }
    /* Stack buttons on very small screens */
    .form-buttons {
        flex-direction: column;
    }
    .btn-submit, .btn-secondary {
        width: 100%;
    }

    /* This reverses the order specifically for mobile view */
    .btn-submit {
        order: 1; /* On mobile, the Next/Register button is first (top) */
    }
    .btn-secondary {
        order: 2; /* On mobile, the Back button is second (bottom) */
    }
}
/* ===================================
   Floating Back Button
====================================== */
.floating-back-btn {
    position: fixed; /* This makes the button "float" relative to the screen */
    top: 70px;
    left: 15px;
    z-index: 1000; /* Ensures the button stays on top of other content */
    
    width: 40px;
    height: 40px;
    background-color: #aaeaf7; /* A light grey background */
    border-radius: 50%; /* Makes it a perfect circle */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Adds a subtle shadow */
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    color: #333; /* Color of the arrow icon */
    text-decoration: none;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.floating-back-btn:hover {
    transform: scale(1.1); /* Slightly enlarges the button on hover */
    background-color: #e9e9e9;
}

/* Style for the SVG icon inside the button */
.floating-back-btn svg {
    width: 25px;
    height: 25px;
}

/* --- FINAL Checkbox Fix --- */

/* This targets the container DIV around the checkbox and label */
.form-group.checkbox-container {
    display: flex; /* This is the key change */
    justify-content: flex-start; /* This forces the content to the left */
    align-items: flex-start;
    gap: 10px;
}

/* This targets the checkbox itself */
.form-group.checkbox-container input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    margin-top: 5px;
}

/* This targets the label text */
.form-group.checkbox-container .checkbox-label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}
/* --- END Fix --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; padding: 15px; }
.modal-content { background: #fff; padding: 25px; border-radius: 8px; max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto; position: relative; }
.modal-close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2em; cursor: pointer; color: #888; }
.terms-content { text-align: left; margin-top: 15px; }
.terms-content h4 { margin-top: 15px; margin-bottom: 5px; }
.terms-content p, .terms-content li { font-size: 0.9em; line-height: 1.6; color: #555; }