/* =========================================================
   ✅ LOGIN.CSS (Clean + Fixed) — My Fatura
   - حل نهائي لمشكلة زر العين (داخل الإطار + يعمل)
   - بدون تكرار أقسام
   ========================================================= */

/* =============================
   1) إعدادات عامة
   ============================= */
:root {
  --brand: #006c35;
  --bg1: #f4f6fa;
  --bg2: #e9eef6;

  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Cairo", sans-serif;
}

body {
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* =============================
   2) شعار أعلى الصفحة
   ============================= */
.site-logo {
  position: static;
  margin-bottom: 30px;
  text-align: center;
}

.logo-text {
  font-size: 50px;
  font-weight: 800;
  color: var(--ink);
}

.logo-main {
  color: var(--brand);
}

/* =============================
   3) الكارد
   ============================= */
.th-register-wrapper {
  position: static;
  width: min(520px, 92vw);
}

.th-register-card {
  background: #ffffff;
  border-radius: 0;
  padding: 40px 36px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);

  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15),
    0 8px 24px -6px rgba(0, 0, 0, 0.05);
}

/* =============================
   4) الحقول (✅ نسخة واحدة فقط)
   ============================= */
.th-form-group {
  margin-bottom: 20px;
}

.th-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #334155;
}

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

/* ✅ أهم سطر: ممنوع flex */
.th-input-wrapper {
  position: relative;
  display: block;
}

/* أيقونة الهاتف/القفل يمين */
.th-input-wrapper i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
}

/* الحقل */
.th-input {
  width: 100%;
  padding: 14px 20px;
  padding-right: 48px; /* مساحة للأيقونة يمين */
  padding-left: 56px;  /* مساحة لزر العين يسار */
  border: 2px solid var(--line);
  border-radius: 0;

  font-size: 1rem;
  transition: 0.2s ease;
  background: var(--soft);
}

.th-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 108, 53, 0.12);
}

/* ================================
   5) زر العين (داخل الإطار)
   ================================ */
.password-wrapper {
  position: relative;
}

/* زر العين يسار داخل الحقل */
.toggle-password {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);

  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  background: transparent;
  border: 0;
  cursor: pointer;

  color: #94a3b8;
  font-size: 18px;

  z-index: 3;
}

.toggle-password:hover {
  color: var(--brand);
}

/* =============================
   6) زر تسجيل الدخول
   ============================= */
.th-btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 0;

  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.2s ease;
  margin-bottom: 18px;
  box-shadow: 0 10px 18px -6px rgba(0, 108, 53, 0.35);
}

.th-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px -8px rgba(0, 108, 53, 0.45);
}

/* =============================
   7) روابط تحت الزر
   ============================= */
.th-login-link {
  text-align: center;
  font-weight: 700;
  color: #334155;
}

.th-login-link a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 800;
  margin-right: 8px;
}

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

/* =============================
   8) رسائل الخطأ
   ============================= */
.th-error-message {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 6px;
  font-weight: 600;
  padding-right: 16px;
}

/* =============================
   9) ريسبونسف
   ============================= */
@media (max-width: 768px) {
  .site-logo {
    position: static;
    text-align: center;
    margin: 22px 0 10px;
  }

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

  .th-register-wrapper {
    position: static;
    margin: 0 auto;
    padding: 10px 0 30px;
  }

  .th-register-card {
    width: 92vw;
    margin: 0 auto;
  }
}
/* =========================================================
   تعديلات صفحة تسجيل الدخول
   1) تصغير البوكس
   2) تصميم رسالة الخطأ
   3) إزالة الخط أسفل My Fatura
   ========================================================= */

/* إزالة أي underline من الشعار */
.site-logo a,
.site-logo a:hover,
.site-logo a:focus,
.logo-text,
.logo-main {
  text-decoration: none !important;
}

/* تصغير المسافة بين الشعار والبوكس */
.site-logo {
  margin-bottom: 18px;
}

/* تصغير حجم الشعار بشكل بسيط */
.logo-text {
  font-size: 42px;
}

/* تصغير بوكس تسجيل الدخول */
.th-register-wrapper {
  width: min(430px, 90vw);
}

.th-register-card {
  padding: 28px 30px;
  border-radius: 14px;
}

/* عنوان تسجيل الدخول */
.login-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.login-heading-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 108, 53, 0.10);
  color: var(--brand);
  border-radius: 10px;
  font-size: 17px;
}

.login-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
}

.login-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

/* تقليل المسافات داخل النموذج */
.th-form-group {
  margin-bottom: 15px;
}

.th-input {
  padding-top: 11px;
  padding-bottom: 11px;
  min-height: 48px;
}

/* تصميم رسالة الخطأ */
.th-alert {
  width: 100%;
  margin-bottom: 16px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.6;
}

.th-alert-error {
  color: #b42318;
  background: #fff2f0;
  border: 1px solid #ffc9c4;
  box-shadow: 0 8px 20px -16px rgba(180, 35, 24, 0.55);
}

.th-alert-error i {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #dc2626;
  background: #ffe4e1;
  border-radius: 50%;
  font-size: 14px;
}

/* تذكرني */
.login-options {
  margin: 2px 0 14px;
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.remember-option input {
  accent-color: var(--brand);
}

/* تصغير زر الدخول قليلًا */
.th-btn-primary {
  padding: 13px 20px;
  font-size: 1rem;
  border-radius: 10px;
  margin-bottom: 14px;
}

/* Dark Mode لرسالة الخطأ */
body.dark .th-alert-error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.20);
  border-color: rgba(248, 113, 113, 0.35);
}

body.dark .th-alert-error i {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.13);
}

body.dark .th-register-card {
  background: #111a21;
  border-color: #273742;
}

body.dark .login-heading h1,
body.dark .th-form-group label,
body.dark .th-login-link {
  color: #f1f5f9;
}

body.dark .login-heading p {
  color: #93a2ae;
}

/* ريسبونسف */
@media (max-width: 768px) {
  .logo-text {
    font-size: 34px;
  }

  .th-register-wrapper {
    width: min(410px, 92vw);
  }

  .th-register-card {
    padding: 24px 20px;
  }
}
/* =========================================================
   واجهة تسجيل الدخول للجوال فقط
   ========================================================= */
@media (max-width: 600px) {
  body {
    min-height: 100dvh;
    display: flex;
    justify-content: flex-start;
    padding:
      max(24px, env(safe-area-inset-top))
      14px
      max(24px, env(safe-area-inset-bottom));
    background:
      radial-gradient(circle at 85% 8%, rgba(0,108,53,.10), transparent 27%),
      linear-gradient(160deg, #f7faf8, #edf3ef 58%, #e8eef2);
  }

  .site-logo {
    width: 100%;
    margin: 26px 0 22px;
  }

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

  main.container {
    width: 100%;
    padding: 0;
  }

  .th-register-wrapper {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 0;
  }

  .th-register-card {
    width: 100%;
    margin: 0;
    padding: 24px 18px 20px;
    border: 1px solid rgba(203, 213, 225, .82);
    border-radius: 20px;
    box-shadow: 0 18px 55px rgba(15, 23, 42, .10);
  }

  .login-heading {
    align-items: center;
    margin-bottom: 22px;
  }

  .login-heading-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 18px;
  }

  .login-heading h1 {
    font-size: 1.35rem;
  }

  .login-heading p {
    margin-top: 4px;
    font-size: .78rem;
  }

  .th-form-group {
    margin-bottom: 16px;
  }

  .th-form-group label {
    font-size: .86rem;
  }

  .th-input {
    min-height: 52px;
    padding-top: 12px;
    padding-bottom: 12px;
    border-radius: 12px;
    font-size: 16px;
  }

  .toggle-password {
    left: 10px;
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  .login-options {
    margin: 3px 0 15px;
  }

  .remember-option {
    font-size: .80rem;
  }

  .remember-option input {
    width: 18px;
    height: 18px;
  }

  .th-btn-primary {
    min-height: 52px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .th-login-link {
    font-size: .84rem;
  }

  .login-processing-card {
    width: min(90vw, 380px) !important;
    padding: 26px 20px !important;
    border-radius: 18px !important;
  }
}

@media (max-width: 380px) {
  body {
    padding-inline: 10px;
  }

  .site-logo {
    margin-top: 18px;
  }

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

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