/* ═══════════════════════════════════════════════════════════
   DataXcel Offer Portal — Shared Styles
   Dark navy (#0f1629) + gold (#c9a84c) theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --bg-primary: #0f1629;
  --bg-card: #161d33;
  --bg-card-alt: #1a2340;
  --bg-input: #1e2744;
  --gold: #c9a84c;
  --gold-light: #dfc477;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --gold-border: rgba(201, 168, 76, 0.3);
  --text-primary: #e8e6e1;
  --text-secondary: #9a9da6;
  --text-muted: #6b7084;
  --accent-green: #4ecb71;
  --accent-red: #e74c3c;
  --accent-blue: #5b9bd5;
  --white: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ═══ Layout ═══ */

.page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-container.narrow {
  max-width: 480px;
}

.page-container.wide {
  max-width: 1100px;
}

/* ═══ Navigation ═══ */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--gold-border);
  margin-bottom: 40px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand img {
  height: 32px;
}

.nav-brand span {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-user {
  font-size: 13px;
  color: var(--text-muted);
}

.nav-user .role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ═══ Buttons ═══ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-primary);
}

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

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.btn-secondary:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

.btn-danger {
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
  background: rgba(231, 76, 60, 0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

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

/* ═══ Forms ═══ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-border);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

/* ═══ Cards ═══ */

.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--gold-border);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.card-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ═══ Status Badges ═══ */

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
}

.badge-draft {
  color: var(--text-muted);
  background: rgba(107, 112, 132, 0.15);
}

.badge-sent {
  color: var(--accent-blue);
  background: rgba(91, 155, 213, 0.12);
}

.badge-viewed {
  color: var(--accent-green);
  background: rgba(78, 203, 113, 0.12);
}

/* ═══ Login Page ═══ */

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card img {
  height: 40px;
  margin-bottom: 8px;
}

.login-card .tagline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
}

.login-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.login-card .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-card .form-group {
  text-align: left;
}

.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

/* ═══ Page Headings ═══ */

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.page-header p {
  font-size: 15px;
  color: var(--text-secondary);
}

.page-header .actions {
  margin-top: 16px;
}

/* ═══ Offer Viewer ═══ */

.offer-viewer {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  min-height: 80vh;
}

.offer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.offer-toolbar .offer-info {
  font-size: 14px;
  color: var(--text-secondary);
}

.offer-toolbar .offer-info strong {
  color: var(--white);
}

/* ═══ Admin: Offer Form ═══ */

.file-drop {
  border: 2px dashed var(--gold-border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}

.file-drop:hover,
.file-drop.dragover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.file-drop p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.file-drop .drop-icon {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--gold);
}

/* ═══ Admin: Invite List ═══ */

.invite-list {
  margin-top: 16px;
}

.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.invite-item .invite-email {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.invite-item .invite-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═══ Empty States ═══ */

.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  color: var(--white);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 24px;
}

/* ═══ Alerts / Toasts ═══ */

.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-success {
  background: rgba(78, 203, 113, 0.1);
  border: 1px solid rgba(78, 203, 113, 0.25);
  color: var(--accent-green);
}

.alert-error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.25);
  color: var(--accent-red);
}

.alert-info {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
}

/* ═══ Modal ═══ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 36px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ═══ Loading ═══ */

.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

/* ═══ Utility ═══ */

.hidden { display: none !important; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }

/* ═══ Responsive ═══ */

@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .login-card {
    padding: 32px 24px;
  }
  .card {
    padding: 20px;
  }
  .card-header {
    flex-direction: column;
    gap: 8px;
  }
  .page-header h1 {
    font-size: 22px;
  }
}
