@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  /* --- Palette: Vayda Enterprise V3 --- */
  --primary-deep: #0f172a;
  --primary-main: #1e293b;

  --accent-gold: #d97706;
  --accent-vivid: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.25);

  --bg-page: #f1f5f9;
  --bg-form: #ffffff;

  --text-head: #0f172a;
  --text-body: #475569;
  --text-sub: #94a3b8;
  --text-on-dark: #f8fafc;

  --border-light: #e2e8f0;
  --border-focus: #d97706;

  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-card: 0 20px 40px -5px rgba(15, 23, 42, 0.1);
  --shadow-input: 0 2px 4px 0 rgba(0, 0, 0, 0.03);
  --shadow-focus: 0 0 0 4px var(--accent-glow);

  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.2s var(--ease-smooth);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  background-color: var(--bg-page);
  color: var(--text-body);
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.5;
}

/* =========================================
   Layout: CSS Grid (Strict 60/40 Split)
   ========================================= */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 32px 32px;
}

.login-container {
  width: 100%;

  /* 1. COMPACT WIDTH: 900px standard width */
  max-width: 900px;

  /* 2. COMPACT HEIGHT: Max 85vh to prevent window scrolling */
  max-height: 85vh;
  min-height: 550px;

  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-card);

  display: grid;
  grid-template-columns: 55% 45%;
  overflow: hidden;
  /* Key: Clip corners and enforce max-height */
  position: relative;

  border: 1px solid rgba(217, 119, 6, 0.25);
}

/* --- Left Side: Storytelling (60%) --- */
.hero-panel {
  /* Grid cell takes full height/width automatically */
  background: linear-gradient(150deg, #0f172a 0%, #1e1b4b 100%);
  position: relative;
  padding: 40px;
  /* Reduced to 40px as requested */
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  /* Allow internal scroll if needed */
  overflow-x: hidden;
}

/* Background Effects */
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.12) 0%, transparent 70%);
  top: -10%;
  right: -10%;
  border-radius: 50%;
  filter: blur(80px);
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}

/* Brand Name Typography */
.brand-name {
  font-size: 2rem;
  /* Compact size */
  margin-bottom: 0.75rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -1px;
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero-logo-large {
  height: 100px;
  /* Reduced for better fit */
  margin-bottom: 1.5rem;
  width: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.hero-title {
  /* Use clamp to prevent text from being too huge on mid-screens */
  font-size: 1.75rem;
  /*font-size: clamp(2rem, 4vw, 3rem);*/
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #fff;
  letter-spacing: -1px;
}

.hero-desc {
  font-size: 1rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 90%;
  font-weight: 400;
}

/* Vertical Value Props */
.props-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  align-items: flex-start;
  text-align: right;

  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.prop-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  transition: transform 0.2s ease;
}

.prop-item:hover {
  transform: translateX(-5px);
}

.prop-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-vivid);
}

.prop-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.prop-text p {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* --- Right Side: Form (40%) --- */
.form-panel {
  /* Grid cell takes remaining space */
  background-color: var(--bg-form);
  padding: 40px;
  /* Reduced to 40px as requested */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
  overflow-y: auto;
  /* SCROLL ONLY FORM if screen is tiny */
  max-height: 100%;
  /* Ensure it respects container height */
}

.form-wrapper {
  width: 100%;
  max-width: 380px;
  animation: fadeIn 1s ease-out;
}

.form-header {
  margin-bottom: 2rem;
  text-align: right;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-main);
  margin-bottom: 1rem;
}

.dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.form-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-head);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: var(--text-sub);
  font-size: 0.9rem;
}

/* Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-main);
  margin-bottom: 0.5rem;
}

.input-container {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  padding-left: 2.5rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-head);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: var(--shadow-input);
}

.form-input:hover {
  border-color: #cbd5e1;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-focus);
}

.form-input::placeholder {
  color: #cbd5e1;
  font-weight: 400;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Password Toggle */
.toggle-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  display: flex;
}

.toggle-btn:hover {
  color: var(--primary-main);
}

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 0.9rem;
  margin-top: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-main) 0%, #0f172a 100%);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

/* Forgot Link (Text Only) */
.forgot-link {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--accent-gold);
}

/* Footer */
.auth-footer {
  margin-top: 25px;
  text-align: center;
  opacity: 0.7;
  /* Make the whole footer subtle */
  transition: opacity 0.3s;
}

.auth-footer:hover {
  opacity: 1;
}

.auth-footer p {
  /* The 'POWERED BY' text */
  font-size: 11px;
  /* Increase legibility slightly */
  font-weight: 600;
  letter-spacing: 1px;
  /* Add spacing for a premium look */
  margin-bottom: 8px;
  /* Space between text and logo */
  text-transform: uppercase;
  color: #94a3b8;
  /* Consistent muted color */
}

.auth-footer img {
  /* The Logo */
  height: 60px;
  /* Constrain height to look like a signature */
  width: auto;
  display: inline-block;
  filter: grayscale(100%);
  /* Optional: Makes it look like a watermark */
  opacity: 0.8;
}

/* Errors */
.text-danger {
  color: #e11d48;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.error-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  color: #e11d48;
  text-align: center;
}

.error-box ul {
  list-style: none;
}

/* Responsive - Increased Breakpoint for Safety */
@media (max-width: 1200px) {
  .login-container {
    display: flex;
    /* Switch back to Flex for vertical stacking */
    flex-direction: column;
    max-width: 600px;
    min-height: auto;
  }

  .hero-panel {
    display: none;
  }

  .form-panel {
    width: 100%;
    max-width: 100%;
    padding: 3rem 2rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes floatOrb {
  from {
    transform: translate(0, 0);
  }

  to {
    transform: translate(30px, -30px);
  }
}

/* ################################# */

/* ======================================================
   SECURE CHANGE PASSWORD PAGE STYLES (Radical Redesign)
   ====================================================== */

/* 1. الخلفية الداكنة المركزة (Focus Mode) */
.secure-page-wrapper {
  min-height: 100vh;
  width: 100%;
  background-color: #0f172a;
  /* Slate 900 */
  background-image: radial-gradient(at top center, #1e293b 0%, #0f172a 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

/* زخرفة خلفية خفيفة */
.bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 2. البطاقة العائمة */
.secure-card-container {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  /* ظل قوي للعمق */
  position: relative;
  z-index: 10;
  overflow: hidden;
  /* شريط علوي ملون لتمييز الصفحة */
  border-top: 6px solid #d97706;
  /* اللون الذهبي الخاص بكم */
}

/* 3. الرأس */
.secure-header {
  text-align: center;
  padding: 2.5rem 2rem 1rem 2rem;
}

.lock-icon-wrapper {
  width: 64px;
  height: 64px;
  background: #fffbeb;
  /* كهرماني فاتح جدا */
  color: #d97706;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 4px 6px -1px rgba(217, 119, 6, 0.1);
}

.secure-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.secure-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.5;
}

/* 4. الجسم والنماذج */
.secure-body {
  padding: 1rem 2rem 2.5rem 2rem;
}

/* تنبيه الأمان */
.security-notice {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 1.5rem;
}

.alert-error {
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: center;
  list-style: none;
}

/* حقل الإيميل (للقراءة فقط) - تصميم بسيط */
.input-group-minimal {
  margin-bottom: 1.5rem;
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  border: 1px dashed #cbd5e1;
}

.label-minimal {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
  margin-bottom: 2px;
}

.static-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #334155;
}

.input-transparent {
  border: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
  font-weight: 600;
  color: #334155;
  outline: none;
}

/* حقول الباسورد الحديثة */
.input-group-modern {
  margin-bottom: 1.25rem;
}

.label-modern {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
}

.input-modern {
  width: 100%;
  padding: 0.85rem 1rem;
  padding-left: 2.5rem;
  /* مساحة للعين */
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s;
  background: #fff;
  color: #0f172a;
}

.input-modern:focus {
  border-color: #d97706;
  /* التركيز باللون الذهبي */
  outline: none;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1);
}

.eye-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
}

.eye-btn:hover {
  color: #d97706;
}

.validation-msg {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 4px;
}

/* زر الحفظ */
.btn-secure-submit {
  width: 100%;
  background: #0f172a;
  /* زر داكن ليعكس الجدية */
  color: #fff;
  padding: 1rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  margin-top: 1rem;
}

.btn-secure-submit:hover {
  background: #1e293b;
  transform: translateY(-2px);
}

.back-link-area {
  text-align: center;
  margin-top: 1.5rem;
}

.link-muted {
  font-size: 0.85rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.link-muted:hover {
  color: #64748b;
}

.secure-footer {
  text-align: center;
  padding-bottom: 1.5rem;
}

/* ################################# */

/* تحديث: استبدال القفل بالشعار */
.secure-logo-wrapper {
  margin-bottom: 1.5rem;
  text-align: center;
}

.secure-logo-main {
  height: 80px;
  /* حجم كبير ومناسب للشعار الرئيسي */
  width: auto;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* تحديث: تكبير وتنسيق شعار الفوتر */
.secure-footer-img {
  height: 50px;
  /* تم التكبير من 20px إلى 35px */
  width: auto;
  opacity: 0.6;
  filter: grayscale(100%);
  transition: all 0.3s ease;
}

.secure-footer-img:hover {
  opacity: 1;
  filter: grayscale(0%);
}
