/* =========================================================
   مهرگان نوین - استایل فوق مدرن نئوبانک (الهام از بلوبانک)
   app.css
   ========================================================= */

:root {
  --bg-main: #141923;
  --bg-surface: #1e2638;
  --bg-surface-elevated: #28334a;
  --card-green-1: #1db978;
  --card-green-2: #148053;
  --card-pattern-bg: #0d442c;
  --accent-cyan: #4ce1b6;
  --accent-blue: #3b82f6;
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.08);
  --radius-card: 26px;
  --radius-btn: 16px;
  --shadow-card: 0 20px 45px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 35px rgba(29, 185, 120, 0.25);
  --font-family: 'Vazirmatn', 'IRANSans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
body,button,span,a,p {
  font-family: var(--font-family);
}
body {

  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.6;
}

/* افکت پس‌زمینه نورانی */
.ambient-glow {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(29, 185, 120, 0.15) 0%, rgba(20, 25, 35, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 18px 60px;
  position: relative;
  z-index: 1;
}

/* هدر مینیمال شبیه بلوبانک */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4px 25px;
}

.app-topbar .logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-topbar .logo-title img {
  height: 38px;
  border-radius: 10px;
}

.app-topbar .logo-title h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.top-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.top-icon-btn:hover {
  background: var(--bg-surface-elevated);
  color: #fff;
}

/* =========================================================
   کانتینر انیمیشن کارت عمودی سه‌بعدی (3D FLIP CARD)
   ========================================================= */

.cards-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 32px;
  perspective: 1400px;
  margin-bottom: 25px;
}

.card-scene {
  width: 280px;
  height: 440px;
  margin: 0 auto;
  perspective: 1200px;
  cursor: pointer;
}

.blu-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.blu-card.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  padding: 30px 24px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
  user-select: none;
}

/* گرادینت سبز اختصاصی کارت مهرگان نوین */
.card-front {
  background: linear-gradient(155deg, var(--card-green-1) 0%, var(--card-green-2) 100%);
  color: #ffffff;
}

.card-front::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.card-back {
  background: linear-gradient(160deg, #10663f 0%, #0a3d25 100%);
  color: #ffffff;
  transform: rotateY(180deg);
  border-left: 22px solid #092f1d;
}

/* المان‌های روی کارت جلو */
.card-front .brand-heading {
  text-align: center;
  margin-top: 35px;
}

.card-front .brand-logo-text {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
}

.card-front .brand-slogan {
  font-size: 0.82rem;
  opacity: 0.9;
  font-weight: 400;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.card-front .chip-icon-wrap {
  text-align: center;
  margin-bottom: 25px;
  opacity: 0.9;
  animation: pulseRotate 4s ease-in-out infinite;
}

/* المان‌های پشت کارت */
.card-back .card-holder-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
  text-align: right;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-back .card-holder-role {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.75);
}

.card-back .card-number-vertical {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: auto 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
}

.card-back .card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 15px;
}

.card-back .meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-back .meta-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.card-back .meta-val {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  direction: ltr;
}

.card-back .brand-watermark {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

/* راهنمای لمس روی کارت */
.card-flip-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* =========================================================
   بخش اکشن‌ها (دکمه‌های کارت و شبای بلوبانک)
   ========================================================= */

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 22px 0 30px;
}

.action-card-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.25s ease;
  cursor: pointer;
}

.action-card-btn:hover {
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.action-card-btn svg {
  stroke: var(--accent-cyan);
}

/* =========================================================
   اعضای خانواده تحت پوشش (Horizontal Badges)
   ========================================================= */

.family-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 25px;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.family-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.family-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.member-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.member-code {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* =========================================================
   بخش لندینگ معرف تخفیفات مهرگان و هدایت به نقشه
   ========================================================= */

.promo-banner {
  background: linear-gradient(145deg, #1d2538 0%, #151c2c 100%);
  border: 1px solid rgba(76, 225, 182, 0.25);
  border-radius: 24px;
  padding: 26px 20px;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.promo-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  left: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(76, 225, 182, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(76, 225, 182, 0.12);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.promo-banner h3 {
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 10px;
  color: #fff;
}

.promo-banner p {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.7;
  margin-bottom: 22px;
}

.btn-primary-glow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: linear-gradient(135deg, #1db978 0%, #17935f 100%);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 16px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(29, 185, 120, 0.4);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(29, 185, 120, 0.55);
}

.btn-secondary-app {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--bg-surface-elevated);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  margin-top: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.btn-secondary-app:hover {
  background: #33415c;
  color: #fff;
}

/* =========================================================
   صفحه ورود (LOGIN STYLES)
   ========================================================= */

.login-wrapper {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 34px 24px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header img {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.input-group-custom {
  position: relative;
  margin-bottom: 24px;
}

.input-group-custom input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-color);
  border-radius: 16px;
  padding: 17px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
  transition: all 0.25s ease;
  font-family: inherit;
}

.input-group-custom input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(76, 225, 182, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.input-group-custom input::placeholder {
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* استایل کادرهای کد ۵ رقمی OTP */
.otp-inputs-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  direction: ltr;
  margin-bottom: 24px;
}

.otp-digit-box {
  width: 48px;
  height: 56px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.otp-digit-box:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(76, 225, 182, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.alert-msg-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  text-align: center;
}

@keyframes pulseRotate {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
/* =========================================================
   استایل کارت اختصاصی مهرگان (Mehrgan Card Design)
   ========================================================= */

:root {
  --mehrgan-red: #8e1c2f;
  --mehrgan-dark: #5a121d;
  --mehrgan-light: #fdfdfd;
}

.mehrgan-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 20px; /* لبه‌های گرد مهرگان */
  box-shadow: 0 10px 30px rgba(142, 28, 47, 0.3);
}

.mehrgan-card.is-flipped {
  transform: rotateY(180deg);
}

/* کارت جلو: زمینه قرمز با لوگو و آیکون */
.card-front.mehrgan-face {
  background: linear-gradient(135deg, var(--mehrgan-red) 0%, var(--mehrgan-dark) 100%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mehrgan-logo-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-icon-wrapper {
  background: rgba(255, 255, 255, 0.15);
  padding: 10px;
  border-radius: 12px;
}

.card-title-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  text-align: right;
  margin-top: 10px;
}

/* کارت پشت: جزئیات و تاریخ انقضا */
.card-back.mehrgan-face {
  background: #fff;
  color: var(--mehrgan-red);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mehrgan-footer-line {
  border-top: 2px solid var(--mehrgan-red);
  padding-top: 10px;
  font-weight: 700;
  text-align: center;
}
/* ===== کارت واقعی مهرگان (تصویر پایه + متن داینامیک) ===== */

/* نام و کد ملی روی نوار سفید کارت جلو */
.front-holder-name {
    position: absolute;
    bottom: 5%;
    right: 8%;
    left: 8%;
    color: #3a3a3a;
    font-weight: 800;
    font-size: clamp(0.75rem, 3.4vw, 1rem);
    line-height: 1.8;
    text-align: center;
}

.front-holder-name .ncode {
    display: block;
    font-size: 0.72em;
    font-weight: 600;
    color: #888;
    letter-spacing: 2px;
}

/* چیپ اطلاعات روی پشت کارت */
.back-info-chip {
    position: absolute;
    top: 34%;
    left: 42%;
    max-width: 52%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    color: #5a121d;
}

.back-info-chip .row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: clamp(0.55rem, 2.5vw, 0.75rem);
    padding: 4px 0;
    border-bottom: 1px dashed rgba(142, 28, 47, 0.25);
}
.back-info-chip .row:last-child { border-bottom: none; }
.back-info-chip .lbl { color: #8a8a8a; font-size: 0.85em; white-space: nowrap; }
.back-info-chip .val { font-weight: 800; }

/* ---------- جلو کارت (کارت خام) ---------- */
/* نوار سفید پایین کارت خام: جای نام و کد ملی */
.front-holder-name {
    position: absolute;
    bottom: 6%;
    right: 22%;
    left: 6%;
    color: #3a3a3a;
    font-weight: 800;
    font-size: clamp(0.8rem, 3.5vw, 1.05rem);
    line-height: 1.9;
}

.front-holder-name .ncode {
    font-size: 0.75em;
    font-weight: 600;
    color: #777;
    letter-spacing: 1px;
}

/* ---------- پشت کارت (کارت QR) ---------- */
/* متن راهنما روی کارت پشت ثابت است؛ فقط یک مهر شیشه‌ای اطلاعات می‌گذاریم */
.back-info-chip {
    position: absolute;
    top: 34%;
    left:255, 0.: 42%;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    color: #5a121d;
    direction: rtl;
}

.back-info-chip .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(0.6rem, 2.6vw, 0.78rem);
    padding: 4px 0;
    border-bottom: 1px dashed rgba(142, 28, 47, 0.25);
}

.back-info-chip .row:last-child { border-bottom: none; }

.back-info-chip .lbl { color: #8a8a8a; font-size: 0.85em; }
.back-info-chip .val { font-weight: 800; }

.card-flip-hint {
    text-align: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted, #999);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
/* استایل‌های لایه متن روی کارت */
.name-overlay {
    position: absolute;
    top: 71%; /* تنظیم دقیق روی نوار سفید */
    width: 100%;
    text-align: center;
    color: #333;
    font-weight: 800;
    font-size: clamp(0.9rem, 3.5vw, 1.2rem);
}

.expiry-overlay {
    position: absolute;
    bottom: 5%;
    left: 8%;
    color: #5a121d;
    font-size: clamp(0.65rem, 2.8vw, 0.9rem);
    font-weight: 700;
    direction: ltr; /* تاریخ به صورت چپ‌چین قشنگ‌تر است */
}

.ncode-overlay {
    position: absolute;
    bottom: 5%;
    right: 8%;
    color: #333;
    font-size: clamp(0.65rem, 2.8vw, 0.9rem);
    font-weight: 700;
}

/* =========================================
   تنظیمات دقیق و شیشه‌ای روی کارت خام مهرگان
   ========================================= */

.realcard-scene {
    perspective: 1200px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.realcard-ratio {
    position: relative;
    width: 100%;
    padding-top: 63%; /* نسبت طلایی استاندارد کارت بانکی */
}

.realcard {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transition: transform 0.75s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.realcard.is-flipped {
    transform: rotateY(180deg);
}

.realcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(90, 18, 29, 0.4);
}

.realcard-face img.bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.realcard-overlay {
    position: absolute;
    inset: 0;
    font-family: 'Vazirmatn', sans-serif;
    pointer-events: none;
}

/* ۱. نام و نام خانوادگی (روی نوار سفید برجسته وسط) */
.card-slot-name {
    position: absolute;
    top: 62.5%;
    right: 17%;
    left: 17%;
    height: 12%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    font-size: clamp(0.85rem, 3.8vw, 1.15rem);
    font-weight: 900;
    letter-spacing: -0.3px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ۲. کد ملی (داخل کادر پایین سمت راست) */
.card-slot-national {
    position: absolute;
    bottom: 5.5%;
    right: 6.5%;
    width: 32%;
    height: 10%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    direction: rtl;
}

.card-slot-national .lbl {
    font-size: clamp(0.55rem, 2.2vw, 0.72rem);
    color: #666;
    font-weight: 600;
}

.card-slot-national .val {
    font-size: clamp(0.7rem, 2.7vw, 0.88rem);
    color: #1a1a1a;
    font-weight: 800;
    font-family: monospace, 'Vazirmatn';
    letter-spacing: 1px;
}

/* ۳. تاریخ پایان (جلو عبارت چاپ‌شده "تاریخ پایان :" در پایین چپ) */
.card-slot-expiry {
    position: absolute;
    bottom: 5.5%;
    left:1%;
    height: 10%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    direction: ltr;
}

.card-slot-expiry .val {
    font-size: clamp(0.68rem, 2.6vw, 0.86rem);
    color: #5a121d;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-family: monospace, 'Vazirmatn';
}

/* ---------- پشت کارت (کارت QR و چیپ شیشه‌ای اطلاعات) ---------- */
.back-info-chip {
    position: absolute;
    top: 28%;
    left: 6%;
    width: 46%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
    direction: rtl;
}

.back-info-chip .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(142, 28, 47, 0.2);
    font-size: clamp(0.62rem, 2.5vw, 0.78rem);
}

.back-info-chip .row:last-child {
    border-bottom: none;
}

.back-info-chip .lbl {
    color: #777;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

.back-info-chip .val {
    font-weight: 800;
    color: #5a121d;
    direction: ltr;
}
