/* ============================= */
/* 1️⃣ إعدادات عامة */
/* ============================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cairo", sans-serif;
}

body {
  background: linear-gradient(135deg, #f4f6fa, #e9eef6);
  min-height: 100vh;
}

.site-logo {
  position: absolute;
  top: 40px;
  right: 240px;
  z-index: 1000;
}

.logo-text {
  font-size: 50px;
  font-weight: 800;
  font-family: "Cairo", sans-serif;
  color: #1e293b;
}

.logo-main {
  color: #006c35;
}

/* ============================= */
/* 2️⃣ تقسيم الصفحة */
/* ============================= */
.th-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================= */
/* 3️⃣ يسار - المميزات */
/* ============================= */
.th-features {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 140px;
}

.th-features-content h2 {
  font-size: 35px;
  margin-bottom: 40px;
  font-weight: 800;
  color: #1e293b;
}

.th-feature-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  align-items: flex-start;
}

.th-feature-item i {
  font-size: 24px;
  color: #006c35;
  margin-top: 6px;
}

.th-feature-item h4 {
  font-size: 20px;
  margin-bottom: 5px;
}

.th-feature-item p {
  color: #64748b;
  font-size: 16px;
}

/* ============================= */
/* 4️⃣ يمين - التسجيل */
/* ============================= */
.container {
  position: relative;
  max-width: 900px;
  margin: 140 140px;
  padding: 50px;
}

.th-register-wrapper {
  width: 100%;
  max-width: 520px;
  margin: 0 110px;
}

/* بطاقة النموذج الأساسية */
.th-register-card {
  background: white;
  border-radius: 0;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15), 0 8px 24px -6px rgba(0, 0, 0, 0.05);
  padding: 40px 36px;
  width: 100%;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ===== الخطوات ===== */
.th-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 25px;
  padding: 0 5px;
}

.th-step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.th-step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.3s;
  flex-shrink: 0;
}

.th-step-item.active .th-step-number {
  background: #006c35;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 108, 53, 0.3);
}

.th-step-item.active {
  color: #1e293b;
}

.th-step-line {
  width: 25px;
  height: 2px;
  background: #e2e8f0;
  margin: 0 3px;
  flex-shrink: 0;
}

.th-step-line.active {
  background: #006c35;
}

.th-step-label {
  font-size: 11px;
  white-space: nowrap;
}

/* ===== عناوين الخطوات ===== */
.th-step-title {
  font-size: 15px;
  color: #1e293b;
  margin-bottom: 14px;
  border-bottom: 2px solid #006c35;
  padding-bottom: 6px;
  font-weight: 700;
}

.th-section-icon {
  color: #006c35;
  margin-left: 8px;
}

/* ===== مجموعة الحقول ===== */
.th-form-group {
  margin-bottom: 14px;
}

.th-form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
}

.th-required {
  color: #dc2626;
  margin-right: 4px;
}

/* ===== تنسيق الحقول في صفوف ===== */
.th-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.th-form-row-single {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* ===== الحقول مع أيقونات ===== */
.th-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.th-input-wrapper i {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.th-input {
  width: 100%;
  padding: 10px 14px 10px 12px;
  padding-right: 38px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
  height: 48px;
  transition: all 0.2s;
  background: #f8fafc;
  color: #1e293b;
}

.th-input:focus {
  outline: none;
  border-color: #006c35;
  background: white;
  box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.1);
}

/* ===== حقل رقم الجوال ===== */
.th-phone-group {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.th-phone-group .th-country-code {
  background: #f1f5f9;
  padding: 0 14px;
  border: 2px solid #e2e8f0;
  border-left: none;
  border-radius: 6px 0 0 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  font-size: 13px;
  height: 48px;
}

.th-phone-group .th-input-wrapper {
  flex: 1;
  min-width: 120px;  /* ← عرض ثابت */
}

.th-phone-group .th-input-wrapper .th-input {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

/* ===== حقل الملف ===== */
.th-file-wrapper {
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  background: #fafbfc;
  padding: 4px;
  transition: all 0.3s;
}

.th-file-wrapper:hover {
  border-color: #006c35;
  background: #f0fdf4;
}

.th-file-wrapper .th-input {
  border: none;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.9rem;
}

.th-file-wrapper .th-input::-webkit-file-upload-button {
  background: #006c35;
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Cairo", sans-serif;
  margin-left: 10px;
  font-size: 0.85rem;
}

.th-file-wrapper .th-input::-webkit-file-upload-button:hover {
  background: #005a2d;
}

/* ===== القائمة المنسدلة ===== */
.th-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.th-select-wrapper i {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.th-select {
  width: 100%;
  padding: 10px 14px 10px 12px;
  padding-right: 38px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  height: 48px;
  background: #f8fafc;
  color: #1e293b;
  font-family: "Cairo", sans-serif;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  cursor: pointer;
  transition: all 0.2s;
}

.th-select:focus {
  outline: none;
  border-color: #006c35;
  background-color: white;
  box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.1);
}

.th-select option {
  padding: 8px 12px;
  font-family: "Cairo", sans-serif;
  font-size: 0.9rem;
}

/* ===== الأزرار (متساوية الحجم) ===== */
.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  width: 100%;
}

.btn-group .th-btn-primary,
.btn-group .th-btn-secondary {
  flex: 1;
  min-width: 0;
}

.th-btn-primary {
  padding: 12px 20px;
  font-size: 0.95rem;
  border-radius: 6px;
  background: #006c35;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px -4px rgba(0, 108, 53, 0.25);
}

.th-btn-primary:hover {
  background: #005a2d;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -6px rgba(0, 108, 53, 0.35);
}

.th-btn-secondary {
  padding: 12px 20px;
  font-size: 0.95rem;
  border-radius: 6px;
  background: #e2e8f0;
  color: #1e293b;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.th-btn-secondary:hover {
  background: #cbd5e1;
  transform: translateY(-2px);
}

/* ===== معاينة ===== */
.th-preview-box {
  background: #f8fafc;
  padding: 14px 18px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.th-preview-box p {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.th-preview-box p:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.th-preview-box strong {
  color: #1e293b;
}

.th-preview-box span {
  color: #006c35;
  font-weight: 600;
}

/* ===== الموافقة ===== */
.th-consent-group {
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 14px 0 12px;
  border: 1px solid #e2e8f0;
}

.th-consent-group label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: #334155;
  font-weight: 500;
  line-height: 1.5;
}

.th-consent-group input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #006c35;
  flex-shrink: 0;
}

/* ===== النصوص السفلية ===== */
.th-terms {
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

.th-terms a {
  color: #006c35;
  text-decoration: none;
  font-weight: 600;
}

.th-terms a:hover {
  text-decoration: underline;
}

.th-login-link {
  text-align: center;
  font-weight: 600;
  color: #334155;
  margin-top: 8px;
  font-size: 0.9rem;
}

.th-login-link a {
  color: #006c35;
  text-decoration: none;
  font-weight: 700;
  margin-right: 4px;
}

.th-login-link a:hover {
  text-decoration: underline;
}

/* ===== تنبيه ===== */
.th-alert {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.th-alert-success {
  background: #e6f7e6;
  color: #006c35;
  border: 1px solid #b3e0b3;
}

.th-alert-error {
  background: #fde8e8;
  color: #dc2626;
  border: 1px solid #f5c6c6;
}

/* ============================= */
/* 6️⃣ موبايل */
/* ============================= */
@media (max-width: 992px) {
  .th-layout {
    flex-direction: column;
  }

  .th-features {
    display: none;
  }
}

@media (max-width: 768px) {
  .th-step-label {
    display: none;
  }

  .th-step-line {
    width: 15px;
  }

  .th-step-number {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .th-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .site-logo {
    position: relative;
    top: 0;
    right: 0;
    text-align: center;
    padding: 20px 0 10px;
  }

  .logo-text {
    font-size: 36px;
  }
}

@media (max-width: 500px) {
  .th-step-number {
    width: 22px;
    height: 22px;
    font-size: 9px;
  }

  .th-step-line {
    width: 10px;
  }
}

        /* ===== تنسيق إضافي للهاتف ===== */
        .phone-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
        }

        .phone-input-wrapper i {
            position: absolute;
            right: 14px;
            color: #94a3b8;
            font-size: 0.9rem;
            pointer-events: none;
            z-index: 2;
        }

        .phone-input-wrapper .th-input {
            padding-right: 38px;
            direction: ltr;
            text-align: left;
            letter-spacing: 1px;
        }

        /* ===== تنسيق زر العين لكلمة المرور ===== */
        .password-field-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .password-field-wrapper .th-input-wrapper {
            flex: 1;
        }

        .password-field-wrapper .th-input-wrapper .th-input {
            padding-left: 48px;
        }

        .password-toggle-btn {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            font-size: 1.1rem;
            padding: 8px;
            z-index: 3;
            transition: color 0.2s;
        }

        .password-toggle-btn:hover {
            color: #006c35;
        }

        /* ===== تنسيق حقل تأكيد كلمة المرور ===== */
        .confirm-password-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .confirm-password-wrapper .th-input-wrapper {
            flex: 1;
        }

        .confirm-password-wrapper .th-input-wrapper .th-input {
            padding-left: 48px;
        }

        .confirm-toggle-btn {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            font-size: 1.1rem;
            padding: 8px;
            z-index: 3;
            transition: color 0.2s;
        }

        .confirm-toggle-btn:hover {
            color: #006c35;
        }

        @media (max-width: 768px) {
            .phone-input-wrapper .th-input {
                font-size: 0.85rem;
                letter-spacing: 0.5px;
            }
        }

/* =========================================================
   إصلاح حقول التسجيل
   ========================================================= */

/* إخفاء زر إظهار كلمة المرور الافتراضي في Edge / IE
   حتى يبقى زر العين الكبير الخاص بالنظام فقط */
.password-field-wrapper input[type="password"]::-ms-reveal,
.password-field-wrapper input[type="password"]::-ms-clear,
.confirm-password-wrapper input[type="password"]::-ms-reveal,
.confirm-password-wrapper input[type="password"]::-ms-clear {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* تثبيت زر العين المخصص */
.password-toggle-btn,
.confirm-toggle-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    line-height: 1 !important;
}

.password-toggle-btn i,
.confirm-toggle-btn i {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

/* تنسيق الجوال كحقل واحد متكامل */
.th-phone-group {
    direction: ltr;
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 0 !important;
}

.th-phone-group .th-country-code {
    direction: ltr;
    height: 48px;
    min-width: 92px;
    justify-content: center;
    padding: 0 12px !important;
    border: 2px solid #e2e8f0 !important;
    border-right: 0 !important;
    border-radius: 6px 0 0 6px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
}

.th-phone-group .phone-input-wrapper {
    flex: 1;
    min-width: 0;
}

.th-phone-group .phone-input-wrapper .th-input {
    height: 48px;
    border: 2px solid #e2e8f0 !important;
    border-left: 0 !important;
    border-radius: 0 6px 6px 0 !important;
    direction: ltr !important;
    text-align: left !important;
    letter-spacing: .6px !important;
    font-variant-numeric: tabular-nums;
}

.th-phone-group:focus-within .th-country-code,
.th-phone-group:focus-within .phone-input-wrapper .th-input {
    border-color: #006c35 !important;
}

.th-phone-group:focus-within .phone-input-wrapper .th-input {
    box-shadow: 0 0 0 4px rgba(0,108,53,.08) !important;
}

/* شاشة انتظار أثناء إنشاء الحساب */
.account-setup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.account-setup-overlay.show {
    display: flex;
}

.account-setup-card {
    width: min(92vw, 420px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
    padding: 30px 24px;
    text-align: center;
    color: #1e293b;
}

.account-setup-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border: 5px solid #dfe8e3;
    border-top-color: #006c35;
    border-radius: 50%;
    animation: accountSetupSpin .85s linear infinite;
}

.account-setup-title {
    font-size: 1.22rem;
    font-weight: 800;
    color: #006c35;
    margin-bottom: 7px;
}

.account-setup-text {
    font-size: .9rem;
    color: #64748b;
    line-height: 1.8;
}

@keyframes accountSetupSpin {
    to { transform: rotate(360deg); }
}

/* =========================================================
   تخطيط الجوال - أصغر ومتناسق
   ========================================================= */
.phone-row-compact {
    display: flex !important;
    justify-content: center !important;
}

.phone-row-compact .th-form-group {
    width: 84% !important;
    max-width: 430px !important;
    margin-inline: auto !important;
}

.phone-row-compact .th-phone-group {
    width: 100% !important;
    direction: ltr !important;
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
}

.phone-row-compact .th-country-code {
    width: 92px !important;
    min-width: 92px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    padding: 0 9px !important;
    border: 2px solid #e2e8f0 !important;
    border-right: 0 !important;
    border-radius: 6px 0 0 6px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
}

.phone-row-compact .sa-flag {
    font-size: 13px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.phone-row-compact .phone-input-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
}

.phone-row-compact .phone-input-wrapper .th-input {
    width: 100% !important;
    height: 48px !important;
    border: 2px solid #e2e8f0 !important;
    border-left: 0 !important;
    border-radius: 0 6px 6px 0 !important;
    direction: ltr !important;
    text-align: left !important;
    padding-left: 42px !important;
    padding-right: 14px !important;
    letter-spacing: .35px !important;
}

.phone-row-compact .phone-input-wrapper > i {
    position: absolute !important;
    left: 14px !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 3 !important;
    color: #94a3b8 !important;
}

.phone-row-compact .th-phone-group:focus-within .th-country-code,
.phone-row-compact .th-phone-group:focus-within .phone-input-wrapper .th-input {
    border-color: #006c35 !important;
}

@media (max-width: 768px) {
    .phone-row-compact .th-form-group {
        width: 100% !important;
        max-width: none !important;
    }
}



/* علم السعودية داخل مفتاح الاتصال */
.phone-row-compact .sa-flag-img {
    width: 20px !important;
    height: 14px !important;
    object-fit: cover !important;
    display: inline-block !important;
    border-radius: 2px !important;
    flex: 0 0 auto !important;
}
/* =========================================================
   صفحة التسجيل الجديدة — شعار + نموذج فقط
   ========================================================= */
body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0%, rgba(0,108,53,.055), transparent 30%),
        linear-gradient(135deg, #f5f7fa, #edf2f7);
}

.site-logo {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    z-index: 5;
    width: 100%;
    padding: 34px 20px 14px !important;
    text-align: center;
}

.site-logo .logo-text {
    display: inline-block;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -.7px;
}

.th-layout {
    display: block !important;
    min-height: auto !important;
}

.th-features {
    display: none !important;
}

main.container {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 16px 20px 48px !important;
}

.th-register-wrapper {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 auto !important;
}

.th-register-card {
    width: 100% !important;
    padding: 34px 34px 30px !important;
    border: 1px solid rgba(226,232,240,.95) !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,.985) !important;
    box-shadow:
        0 24px 60px rgba(15,23,42,.10),
        0 8px 22px rgba(15,23,42,.05) !important;
    backdrop-filter: blur(10px);
}

/* توازن الشكل على الشاشات المتوسطة والكبيرة */
@media (min-width: 769px) {
    .site-logo {
        padding-top: 42px !important;
        padding-bottom: 18px !important;
    }

    main.container {
        padding-top: 8px !important;
    }

    .th-register-wrapper {
        max-width: 570px !important;
    }
}

/* الجوال */
@media (max-width: 768px) {
    body {
        background:
            radial-gradient(circle at 50% 0%, rgba(0,108,53,.06), transparent 28%),
            linear-gradient(160deg, #f7f9fb, #edf2f7);
    }

    .site-logo {
        padding: 24px 14px 14px !important;
    }

    .site-logo .logo-text {
        font-size: 34px !important;
    }

    main.container {
        padding: 8px 12px 28px !important;
    }

    .th-register-wrapper {
        max-width: 430px !important;
    }

    .th-register-card {
        padding: 24px 18px 22px !important;
        border-radius: 15px !important;
        box-shadow: 0 18px 42px rgba(15,23,42,.09) !important;
    }

    .th-register-card > h2 {
        font-size: 20px !important;
    }

    .th-register-card > p {
        margin-bottom: 15px !important;
    }
}

@media (max-width: 390px) {
    .site-logo {
        padding-top: 20px !important;
    }

    .site-logo .logo-text {
        font-size: 31px !important;
    }

    main.container {
        padding-inline: 9px !important;
    }

    .th-register-card {
        padding-inline: 14px !important;
    }
}
