/* ── ISOPEDIA Marketplace CSS ─────────────────────────────── */
:root {
  --primary: #1e3a8a;
  --primary-dark: #14295c;
  --primary-light: #e8edf7;
  --accent: #0ea5e9;
  --gradient: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%);
  --star: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand span { color: var(--accent); }

.brand-tagline {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gray-400);
  border-left: 1px solid var(--gray-200);
  padding-left: 8px;
  margin-left: 2px;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s;
}
.brand-tagline:hover { color: var(--primary); text-decoration: none; }
.navbar-brand img { width: 36px; height: 36px; }

.navbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  padding: 9px 16px 9px 42px;
  border: 1.5px solid var(--gray-200);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.navbar-search input:focus { border-color: var(--primary); }

.navbar-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.navbar-actions .nav-link {
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  text-decoration: none;
}

.navbar-actions .nav-link:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}

.cart-btn:hover { background: #d1dff7; text-decoration: none; }

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: 24px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  transition: border-color .15s;
}

.user-btn:hover { border-color: var(--primary); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: 6px 0;
  z-index: 200;
  display: none;
}

.dropdown-menu.open { display: block; }

.dropdown-menu a, .dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--gray-700);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background .1s;
}

.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: var(--gray-50);
  text-decoration: none;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 4px 0;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: var(--gradient);
  color: #fff;
  padding: 80px 0 60px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero h1 span { color: #7dd3fc; }

.hero p {
  font-size: 18px;
  opacity: .85;
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-search {
  display: flex;
  gap: 0;
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  outline: none;
  color: var(--gray-800);
}

.hero-search button {
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 28px;
  cursor: pointer;
  transition: background .15s;
}

.hero-search button:hover { background: #0284c7; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.hero-stat-item { text-align: center; }
.hero-stat-item strong { display: block; font-size: 28px; font-weight: 800; }
.hero-stat-item span { font-size: 13px; opacity: .75; }

/* ── Section ─────────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ── ISO Filter Tabs ─────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 24px;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.filter-tab:hover, .filter-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* ── Package Cards ───────────────────────────────────────── */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.package-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}

.package-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.package-cover {
  height: 180px;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
}

.package-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.package-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.8);
  gap: 8px;
}

.package-cover-placeholder svg { width: 40px; height: 40px; opacity: .6; }
.package-cover-placeholder span { font-size: 13px; font-weight: 600; }

.iso-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.package-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.package-seller {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.seller-avatar-sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.package-seller span { font-size: 12px; color: var(--gray-500); }

.verified-badge {
  color: var(--primary);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.package-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.package-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.package-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--gray-500);
}

.package-meta span { display: flex; align-items: center; gap: 4px; }

.package-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--gray-100);
  padding-top: 16px;
}

.package-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.package-price.free { color: var(--success); }

.star-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-500);
}

.stars { color: var(--star); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,138,.1);
}

.form-control.error { border-color: var(--danger); }

textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error.visible { display: block; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--gray-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn .25s ease;
  max-width: 360px;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--gray-900); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Badge ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #d1fae5; color: #059669; }
.badge-yellow { background: #fef3c7; color: #d97706; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 32px 0;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
}

.page-header p {
  color: var(--gray-500);
  margin-top: 4px;
  font-size: 14px;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.breadcrumb a { color: var(--gray-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--gray-300); }

/* ── Package Detail ──────────────────────────────────────── */
.package-detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .package-detail-grid { grid-template-columns: 1fr; }
}

.detail-cover {
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gradient);
  margin-bottom: 24px;
}

.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.package-buy-card {
  position: sticky;
  top: 80px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.buy-price {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
}

.document-list { list-style: none; }

.document-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  gap: 12px;
}

.document-list li:last-child { border-bottom: none; }

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-type  { font-size: 12px; color: var(--gray-400); }

/* ── Chat ────────────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 64px);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (max-width: 768px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-sidebar.mobile-visible { display: flex; }
}

.chat-sidebar {
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--gray-100);
  font-weight: 700;
  font-size: 15px;
}

.room-list { flex: 1; overflow-y: auto; }

.room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--gray-50);
}

.room-item:hover, .room-item.active { background: var(--primary-light); }

.room-item .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.room-item .info { flex: 1; min-width: 0; }
.room-item .name { font-weight: 600; font-size: 14px; }
.room-item .preview { font-size: 12px; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.unread-dot {
  width: 18px;
  height: 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-main {
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.message-row.me { flex-direction: row-reverse; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.message-row.me .msg-avatar { background: var(--primary); color: #fff; }

.message-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message-row:not(.me) .message-bubble {
  background: var(--gray-100);
  color: var(--gray-800);
  border-bottom-left-radius: 4px;
}

.message-row.me .message-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 3px;
  text-align: right;
}

.message-row:not(.me) .msg-time { text-align: left; }

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 100px;
  transition: border-color .2s;
  font-family: inherit;
}

.chat-input:focus { border-color: var(--primary); }

/* ── Seller Dashboard ────────────────────────────────────── */
.seller-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

@media (max-width: 900px) {
  .seller-layout { grid-template-columns: 1fr; }
}

.seller-sidebar {
  background: var(--gray-900);
  padding: 24px 0;
}

.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 16px;
  font-size: 14px;
  color: rgba(255,255,255,.6);
}

.sidebar-brand strong { display: block; color: #fff; font-size: 15px; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.65);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, background .15s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.sidebar-nav a.active { border-left: 3px solid #60a5fa; }

.seller-content { padding: 32px; background: var(--gray-50); }

/* ── Stats cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.stat-card .label { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 800; color: var(--gray-900); }
.stat-card .change { font-size: 12px; margin-top: 4px; color: var(--success); }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
tr:hover td { background: var(--gray-50); }

/* ── Cart / Checkout ─────────────────────────────────────── */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
}

.order-summary {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 80px;
}

.order-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  border-top: 2px solid var(--gray-200);
  padding-top: 16px;
  margin-top: 16px;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-400);
}

.empty-state svg { width: 64px; height: 64px; margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Loading ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.spinner.dark {
  border-color: rgba(0,0,0,.1);
  border-top-color: var(--primary);
}

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

/* ── Preview modal ───────────────────────────────────────── */
.preview-iframe {
  width: 100%;
  height: 70vh;
  border: none;
  border-radius: var(--radius-sm);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--gray-900);
  color: rgba(255,255,255,.6);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

footer h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 8px; }
footer ul li a { color: rgba(255,255,255,.5); font-size: 13px; text-decoration: none; transition: color .15s; }
footer ul li a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f0fe 0%, #fff 100%);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo a {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.auth-logo a span { color: var(--accent); }

.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.role-option {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}

.role-option:hover { border-color: var(--primary); }
.role-option.selected { border-color: var(--primary); background: var(--primary-light); }
.role-option .icon { font-size: 28px; margin-bottom: 6px; }
.role-option .label { font-size: 13px; font-weight: 600; color: var(--gray-700); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-search { display: none; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }
  .packages-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .container { padding: 0 16px; }
}

@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .hero-stats { gap: 24px; }
  .section { padding: 40px 0; }
}
