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

/* ==========================================================================
   SiteJupiter Client Portal - Design System & Theme
   ========================================================================== */
:root {
  --primary: #1346af;
  --secondary: #2563eb;
  --bg: #f8fafc;
  --bg-secondary: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: rgba(15, 23, 42, 0.08);
  --border-focus: #2563eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(19, 70, 175, 0.12);
  --gradient: linear-gradient(135deg, #1346af, #2563eb);
  --gradient-hover: linear-gradient(135deg, #2563eb, #1d4ed8);
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;

  --font-heading: 'Poppins', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --secondary: #60a5fa;
  --bg: #0b1120;
  --bg-secondary: #111827;
  --surface: #131d33;
  --surface-alt: #1a2744;
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.6);
  --gradient: linear-gradient(135deg, #2563eb, #3b82f6);
  --gradient-hover: linear-gradient(135deg, #3b82f6, #60a5fa);
  --success-bg: rgba(22, 163, 74, 0.15);
  --warning-bg: rgba(217, 119, 6, 0.15);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--secondary);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.client-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  font-family: var(--font-heading);
}

.navbar-brand img {
  height: 34px;
  width: auto;
  border-radius: 6px;
}

.brand-text {
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-top: -2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.theme-toggle-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.security-badge svg {
  color: var(--success);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.client-main {
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 32px auto;
  padding: 0 20px 48px;
}

/* Card Component */
.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}

.client-card-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
}

.client-card-body {
  padding: 32px;
}

/* ==========================================================================
   Invoice Specific Layout
   ========================================================================== */
.invoice-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.invoice-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.invoice-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.invoice-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .invoice-grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.meta-block-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.meta-block-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.meta-block-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Service Scope Box */
.service-scope-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 28px;
}

.scope-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.scope-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Financial Breakdown Summary */
.financial-summary {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 32px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.summary-row.highlight {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 14px;
  font-size: 16px;
  font-weight: 700;
}

.summary-row.advance-row {
  background: var(--success-bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  color: var(--success);
  font-weight: 600;
}

/* Progress Bar */
.payment-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 16px 0 8px;
}

.payment-progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Payment Selection Cards
   ========================================================================== */
.payment-options-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.payment-option-card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.payment-option-card:hover {
  border-color: rgba(37, 99, 235, 0.4);
  background: var(--surface-alt);
}

.payment-option-card.selected {
  border-color: var(--secondary);
  background: rgba(37, 99, 235, 0.04);
  box-shadow: 0 0 0 1px var(--secondary);
}

.option-radio {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--secondary);
  cursor: pointer;
}

.option-content {
  flex: 1;
}

.option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.option-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-heading);
}

.option-amount {
  font-weight: 700;
  font-size: 17px;
  color: var(--primary);
}

.option-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.option-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 6px;
}

[data-theme="dark"] .option-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* Custom Input Field */
.custom-amount-wrapper {
  margin-top: 12px;
  display: none;
}

.payment-option-card.selected .custom-amount-wrapper {
  display: block;
}

.custom-input-box {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 240px;
}

.custom-currency-prefix {
  position: absolute;
  left: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 16px;
}

.custom-amount-input {
  width: 100%;
  padding: 10px 14px 10px 32px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-amount-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.custom-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==========================================================================
   Buttons & Actions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--gradient);
  color: #ffffff !important;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 15px 30px -5px rgba(37, 99, 235, 0.4);
}

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

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

.btn-outline:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-green {
  background: #dcfce7;
  color: #15803d;
}

.badge-amber {
  background: #fef3c7;
  color: #b45309;
}

.badge-soft {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

[data-theme="dark"] .badge-green {
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

[data-theme="dark"] .badge-amber {
  background: rgba(217, 119, 6, 0.2);
  color: #fcd34d;
}

/* Trust Elements */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Success Confirmation Screen */
.success-screen {
  text-align: center;
  padding: 40px 20px;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: #15803d;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .success-icon-wrap {
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

.success-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.success-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Past Payments Table */
.past-payments-box {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.past-payment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
}

/* Footer */
.client-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
}

.client-footer a {
  color: var(--text-secondary);
  margin: 0 8px;
}
