/* =================================================================
   Global Styles for WhatsApp SaaS Platform
   ================================================================= */

/* --- Variables --- */
:root {
    --primary-color: #008069;
    --primary-light: #00A884;
    --background-color: #111B21;
    --card-color: #202C33;
    --text-color: #E9EDEF;
    --border-color: #374045;
    --input-bg-color: #2A3942;
    --danger-color: #DC3545;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --primary-color: #008069;
    --primary-light: #00A884;
    --background-color: #F0F2F5;
    --card-color: #FFFFFF;
    --text-color: #111B21;
    --border-color: #E9EDEF;
    --input-bg-color: #F0F2F5;
    --danger-color: #DC3545;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* --- General Resets & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif; /* Assuming Tajawal is linked or imported */
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-size: 16px;
}

/* --- Authentication Container & Form --- */
.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-form {
    background-color: var(--card-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-light);
    font-size: 1.8rem;
}

.auth-form p {
    text-align: center;
    margin-bottom: 25px;
    opacity: 0.8;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 8px rgba(0, 168, 132, 0.4);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* --- Auth Switch Link --- */
.auth-switch {
    text-align: center;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 700;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.fancy-background {
    background: linear-gradient(135deg, #1a2a3a, #2a4a6a);
    background-size: cover;
    animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.captcha-group .captcha-challenge {
    font-weight: bold;
    color: #ffc107;
    letter-spacing: 2px;
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
}

.auth-links {
    text-align: center;
    margin-top: 15px;
}

.auth-links a {
    color: var(--primary-light);
    text-decoration: none;
}

/* --- Status/Alert Messages --- */
.alert {
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.alert-success {
    background-color: #D1E7DD;
    color: #0F5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}
/* Styles for input validation icons */
/* Styles for input validation icons */
.input-wrapper {
    position: relative;
}

.validation-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
}

.validation-icon.valid::before {
    content: '✓';
    color: #28a745; /* Green for valid */
}

.validation-icon.invalid::before {
    content: '✗';
    color: #dc3545; /* Red for invalid */
}

.phone-validation-icon {
    /* Adjust the position for the phone field specifically */
    right: auto;
    left: 150px; /* Position it after the country code dropdown */
}
/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 450px;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    left: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    opacity: 0.7;
}
.modal-close:hover {
    opacity: 1;
}

.error-modal .error-icon {
    font-size: 48px;
    color: var(--danger-color);
    margin-bottom: 15px;
}

.error-modal h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.error-modal p {
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

.error-modal .btn {
    width: auto;
    padding: 10px 30px;
}
/* --- Packages Modal --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1001; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: var(--card-color);
    margin: 15% auto;
    padding: 25px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
}

.close-button {
    color: #aaa;
    position: absolute;
    left: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

#packages-list ul {
    list-style: none;
    padding: 0;
}

#packages-list li {
    background-color: var(--input-bg-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
}

#packages-list li strong {
    color: var(--primary-light);
    font-size: 1.1rem;
}

#packages-list li p {
    margin: 5px 0 0;
    opacity: 0.9;
}

#packages-list li div {
    margin-top: 10px;
}

#packages-list li div ul {
    list-style-type: disc;
    padding-right: 20px; /* For RTL */
    margin-top: 5px;
}

#packages-list li div ul li {
    background: none;
    border: none;
    padding: 2px 0;
    margin-bottom: 0;
}
/* --- Pricing Card Styles --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.pricing-card {
    background-color: var(--input-bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.pricing-card.recommended {
    border-color: var(--primary-light);
    border-width: 2px;
}

.recommends-badge {
    position: absolute;
    top: 15px;
    right: -30px;
    background-color: var(--primary-light);
    color: white;
    padding: 5px 30px;
    font-size: 0.8rem;
    font-weight: bold;
    transform: rotate(45deg);
    transform-origin: top right;
}

.pricing-card .card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.pricing-card .card-header h3 {
    font-size: 1.4rem;
    color: var(--primary-light);
    margin-bottom: 10px;
}

.pricing-card .price {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
}

.pricing-card .price small {
    font-size: 1rem;
    font-weight: normal;
    opacity: 0.7;
}

.pricing-card .duration {
    font-size: 0.9rem;
    opacity: 0.6;
}

.pricing-card .card-body {
    padding: 20px;
    flex-grow: 1;
}

.pricing-card .card-body ul {
    list-style: none;
    padding: 0;
    text-align: right; /* RTL */
}

.pricing-card .card-body ul li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    background: none;
    border: none;
    padding: 0;
}

.pricing-card .card-body ul li .fa-check-circle {
    color: var(--primary-color);
    margin-left: 8px; /* RTL */
}

.pricing-card .card-footer {
    padding: 20px;
}

.btn-select-package {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    display: block;
    transition: background-color 0.3s;
}

.btn-select-package:hover {
    background-color: var(--primary-light);
}

.pricing-card.recommended .btn-select-package {
    background-color: var(--primary-light);
}
.pricing-card.recommended .btn-select-package:hover {
    background-color: #00c29b;
}

.modal-content {
    max-width: 900px; /* Increase modal width for grid */
}