/* ═══════════════════════════════════════════════════════
   Telugu Christian Matrimony — Mobile First CSS
   ═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --primary:       #6B4E8B;
  --primary-dark:  #3D2A5C;
  --primary-light: #9B7EC8;
  --accent:        #C9A84C;
  --success:       #4A7C59;
  --error:         #C0392B;
  --gold:          #C9A84C;
  --bg:            #FAFFF8;
  --bg2:           #F3F8F0;
  --border:        #E0EBD8;
  --text:          #1A2410;
  --text2:         #3D4D35;
  --text3:         #7A8C72;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 8px 32px rgba(74,124,89,.10);
  --navbar-h:      60px;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Prevent iOS input zoom — ALL inputs must be 16px */
input, select, textarea, button {
  font-size: 16px;
  font-family: 'DM Sans', sans-serif;
}

/* Touch improvements */
a, button, .btn, [onclick] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 2px; }

/* ── NAVBAR ──────────────────────────────────────────── */
.navbar {
  height: var(--navbar-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(74,124,89,.06);
}
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.nav-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; flex-shrink: 0;
}
.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 15px; font-weight: 700; color: var(--primary-dark);
  white-space: nowrap;
}
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a {
  padding: 7px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text3); text-decoration: none; transition: all .15s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { background: var(--bg2); color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px; cursor: pointer;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 18px;
  border-radius: var(--radius); border: none;
  font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all .2s; white-space: nowrap;
  min-height: 44px; /* touch target */
}
.btn-primary { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; }
.btn-primary:hover { opacity: .9; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; min-height: 36px; }
.btn-success { background: #EAF3DE; color: #3B6D11; }
.btn-danger  { background: #FCEBEB; color: #A32D2D; border: none; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; min-height: 36px; }
.btn-outline-sm { background: white; border: 1.5px solid var(--border); color: var(--text2); }
.btn-ghost-sm { background: var(--bg2); border: none; color: var(--text3); }

/* ── FORMS ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-control {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px; /* IMPORTANT: prevents iOS zoom */
  color: var(--text); background: white;
  transition: border .2s, box-shadow .2s; outline: none;
  -webkit-appearance: none; appearance: none;
  min-height: 48px; /* touch target */
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(107,78,139,.1); }
.form-control::placeholder { color: var(--text3); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A8C72' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}

/* ── CARDS ───────────────────────────────────────────── */
.card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 20px; box-shadow: 0 2px 8px rgba(74,124,89,.04); }

/* ── ALERTS ──────────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 14px; line-height: 1.5; }
.alert-success { background: #EAF3DE; color: #3B6D11; border: 1px solid #C3DFB3; }
.alert-error   { background: #FCEBEB; color: #A32D2D; border: 1px solid #F5BCBC; }
.alert-info    { background: #EEE8F8; color: #4A2D8B; border: 1px solid #D4C3E8; }
.alert-warning { background: #FFF8E1; color: #7A5F00; border: 1px solid #F0D58C; }

/* ── BADGES ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 50px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-primary { background: #EEE8F8; color: var(--primary); }
.badge-success { background: #EAF3DE; color: var(--success); }
.badge-warning { background: #FFF8E1; color: var(--accent); }
.badge-danger  { background: #FCEBEB; color: var(--error); }

/* ── PAGE LAYOUT ─────────────────────────────────────── */
.page-container { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.page-title { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-sub   { font-size: 14px; color: var(--text3); margin-bottom: 20px; }
.two-col { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }

/* ── PROFILE CARDS ───────────────────────────────────── */
.profiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.profile-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; cursor: pointer; transition: all .2s; }
.profile-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.profile-img-wrap { position: relative; }
.profile-body { padding: 12px 14px 14px; }
.profile-name { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 2px; }
.profile-meta { font-size: 11px; color: var(--text3); line-height: 1.5; margin-bottom: 10px; }
.p-badge { position: absolute; bottom: 6px; left: 6px; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: white; font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 50px; text-transform: uppercase; }

/* ── DATA TABLE ──────────────────────────────────────── */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.data-table th { background: var(--bg2); padding: 9px 10px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--bg2); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg); }
.data-table tr:last-child td { border-bottom: none; }

/* ── PAGINATION ──────────────────────────────────────── */
.pagination { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.page-btn { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; background: white; transition: all .2s; min-height: 40px; }
.page-btn.active, .page-btn:hover:not(:disabled) { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── LOADING ─────────────────────────────────────────── */
.loading-center { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--text3); font-size: 14px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ── PROGRESS ────────────────────────────────────────── */
.progress-bar-wrap { background: var(--bg2); border-radius: 50px; height: 8px; margin: 8px 0 20px; }
.progress-bar { height: 8px; border-radius: 50px; background: linear-gradient(90deg, var(--success), var(--primary)); transition: width .5s; }
.progress-label { font-size: 12px; color: var(--text3); margin-bottom: 4px; }

/* ── HERO ────────────────────────────────────────────── */
.hero { background: linear-gradient(160deg, #2A3F32, #4A2D8B, #6B4E8B); color: white; text-align: center; padding: 60px 16px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(28px, 5vw, 52px); font-weight: 700; margin-bottom: 14px; line-height: 1.2; }
.hero p { font-size: 16px; opacity: .85; max-width: 520px; margin: 0 auto 28px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── MOBILE RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
  /* Navbar */
  .nav-links { display: none; }
  .navbar { padding: 0 12px; }
  .nav-brand { font-size: 13px; }

  /* Layout */
  .page-container { padding: 16px 12px; }
  .page-title { font-size: 22px; }
  .two-col { grid-template-columns: 1fr; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .card { padding: 16px; border-radius: 12px; }

  /* Profiles */
  .profiles-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .profile-body { padding: 10px 12px 12px; }
  .profile-name { font-size: 13px; }
  .profile-meta { font-size: 10px; }

  /* Buttons in profile cards */
  .profile-body .btn-sm { font-size: 11px; padding: 5px 8px; }

  /* Hero */
  .hero { padding: 40px 14px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .btn { width: 100%; max-width: 280px; }

  /* Admin sidebar on mobile */
  .admin-wrap { flex-direction: column; }
  .sidebar {
    width: 100%; min-height: auto;
    position: static;
  }
  .sidebar-logo { padding: 14px 16px 10px; }
  .sidebar-nav {
    display: flex; flex-wrap: wrap;
    gap: 4px; padding: 8px 12px 12px;
  }
  .sidebar-nav a { padding: 8px 12px; border-radius: 8px; font-size: 12px; }
  .sidebar-nav .section-label { display: none; }
  .admin-main { padding: 16px 12px; }

  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .stat-num { font-size: 26px !important; }
  .stat-card { padding: 14px; }

  /* Section tabs */
  .section-tabs, .form-tabs, .step-indicator {
    flex-wrap: wrap; gap: 6px;
  }
  .stab, .ftab { font-size: 12px; padding: 7px 12px; }

  /* Filter sidebar in search */
  .filter-card { position: static !important; }
  .pid-search { flex-direction: column; }
  .pid-search button { width: 100%; }

  /* Plan modal */
  .plan-modal .plan-box { width: 95vw; max-width: 380px; }

  /* Password popup */
  .pwd-box { width: 92vw; padding: 24px 18px; }
  .pwd-display .pwd { font-size: 22px; }
}

@media (max-width: 420px) {
  .profiles-grid { grid-template-columns: 1fr; }
  .two-col { gap: 12px; }
  .navbar { gap: 8px; }
  .nav-logo-icon { width: 30px; height: 30px; font-size: 14px; }
  .nav-brand { font-size: 12px; }
}

/* ── UTILITIES ───────────────────────────────────────── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px;  } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex  { display: flex; } .flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
