:root {
    --primary-color: #1e40af; /* Medium-dark blue */
    --primary-hover: #1e3a8a;
    --background-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --error-color: #ef4444;
    --success-color: #10b981;
    --border-color: #d1d5db;
    --radius: 12px;
    --spacing: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* Container / Card */
.container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Features List */
.features-list {
    list-style: none;
    text-align: start; /* Resets center align from header */
    margin: 0 auto;
    display: inline-block; /* Keeps list compacted if text is short */
    width: 100%;
}

.features-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.features-list .check {
    color: var(--success-color);
    font-weight: bold;
    margin-inline-end: 10px; /* Logical property for RTL/LTR */
    font-size: 1.2rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Phone Input Specifics */
.phone-input-wrapper {
    display: flex;
    direction: ltr; /* Phone numbers always LTR usually */
    align-items: stretch;
}

/* If the main doc is RTL, we want the phone input to still look sane.
   Actually, the user requirement is RTL for Arabic.
   A phone number field typically looks best LTR, but the label checks RTL.
*/
[dir="rtl"] .phone-input-wrapper {
    flex-direction: row; /* Keeps +213 on the left */
}

.country-code {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    border-right: none; /* Merged look LTR */
    border-radius: 8px 0 0 8px;
    padding: 0 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: sans-serif; /* Numbers look better in sans */
}

.phone-input-wrapper input {
    border-radius: 0 8px 8px 0;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-group input {
    margin-top: 0.3rem;
    accent-color: var(--primary-color);
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
}

/* Button */
button[type="submit"] {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
}

button[type="submit"]:hover {
    background-color: var(--primary-hover);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Messages & States */
.hidden {
    display: none !important;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.message.error {
    background-color: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

#loading-indicator {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success View */
#success-view {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: #d1fae5; /* Light green */
    color: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1.5rem auto;
}

#success-view h2 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

#success-view p {
    color: var(--text-muted);
}

/* Mobile Tweaks */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
}
