/* ============================================================ */
/* LANDLINE PORTAL — Tree Supply Co. Customer Portal */
/* Design system matching admin portal with customer-friendly UX */
/* ============================================================ */

/* ── VARIABLES ────────────────────────────────────────────── */
:root {
  --emerald: #0B2A1A;
  --emerald-mid: #1B5E3B;
  --emerald-bright: #2D8A58;
  --copper: #B87333;
  --copper-dark: #D4883B;
  --copper-dim: rgba(184, 115, 51, 0.15);
  --platinum: #E5E4E2;
  --ghost-border: rgba(229, 228, 226, 0.08);
  --text-primary: #E5E4E2;
  --text-dim: rgba(229, 228, 226, 0.35);
  --font-display: 'Cormorant Garamond', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'DM Sans', sans-serif;
}

/* ── RESET & BASE ─────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--emerald);
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── LOADING SCREEN ───────────────────────────────────────── */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
}

.logo-loading {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--platinum);
  margin-bottom: 32px;
}

.logo-loading .co {
  color: var(--copper);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(229, 228, 226, 0.1);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

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

.loading-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── ERROR SCREEN ─────────────────────────────────────────── */
.error-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.error-content {
  text-align: center;
  max-width: 480px;
  padding: 40px;
}

.error-icon {
  font-size: 64px;
  margin: 24px 0;
}

.error-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--platinum);
  margin-bottom: 16px;
}

.error-message {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.8;
}

.error-message a {
  color: var(--copper);
  text-decoration: none;
}

.error-message a:hover {
  text-decoration: underline;
}

/* ── HEADER ───────────────────────────────────────────────── */
.portal-header {
  height: 72px;
  border-bottom: 1px solid var(--ghost-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(11, 42, 26, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--platinum);
}

.logo .co {
  color: var(--copper);
}

.quote-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--copper);
  letter-spacing: 0.05em;
}

/* ── PORTAL WRAPPER ───────────────────────────────────────── */
.portal-wrapper {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 32px;
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .portal-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ── STATUS BANNER ────────────────────────────────────────── */
.status-banner {
  background: rgba(229, 228, 226, 0.04);
  border: 1px solid var(--ghost-border);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  border-radius: 4px;
  background: var(--emerald-bright);
  color: white;
}

.status-badge.pending {
  background: #FFD700;
  color: #0B2A1A;
}

.status-badge.expired {
  background: #cc4444;
  color: white;
}

.expiry-countdown {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── PORTAL CARDS ─────────────────────────────────────────── */
.portal-card {
  background: rgba(229, 228, 226, 0.04);
  border: 1px solid var(--ghost-border);
  padding: 32px;
  margin-bottom: 24px;
  border-radius: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--platinum);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ghost-border);
}

/* ── CUSTOMER INFO ────────────────────────────────────────── */
.customer-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(229, 228, 226, 0.04);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.info-value {
  font-size: 14px;
  color: var(--platinum);
  font-weight: 500;
}

/* ── LINE ITEMS ───────────────────────────────────────────── */
.line-item {
  padding: 20px 0;
  border-bottom: 1px solid rgba(229, 228, 226, 0.04);
}

.line-item:last-child {
  border-bottom: none;
}

.line-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.line-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--platinum);
}

.line-item-price {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--copper);
  font-weight: 600;
}

.line-item-latin {
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.line-item-details {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

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

.line-item-detail-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.line-item-detail-value {
  color: var(--platinum);
  font-weight: 500;
}

.badge-specimen {
  border: 1px solid var(--copper);
  color: var(--copper);
  font-size: 9px;
  font-weight: 700;
  padding: 3px 10px;
  text-transform: uppercase;
  background: var(--copper-dim);
  font-family: var(--font-mono);
  border-radius: 3px;
}

/* ── PRICING BREAKDOWN ────────────────────────────────────── */
.pricing-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(229, 228, 226, 0.04);
}

.pricing-row:last-child {
  border-bottom: none;
}

.subtotal-row {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(229, 228, 226, 0.1);
}

.total-row {
  font-weight: 600;
  font-size: 18px;
  color: var(--platinum);
  border-top: 2px solid var(--emerald-bright);
  padding-top: 16px;
  margin-top: 8px;
}

.deposit-row {
  background: var(--copper-dim);
  padding: 16px;
  border-radius: 6px;
  margin-top: 16px;
  border: 1px solid var(--copper);
}

.pricing-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.deposit-row .pricing-label {
  color: var(--copper);
  font-weight: 700;
}

.pricing-value {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--platinum);
  font-weight: 600;
}

.deposit-row .pricing-value {
  color: var(--copper);
  font-size: 18px;
}

.pdf-download-wrapper {
  margin-top: 24px;
  text-align: center;
}

/* ── ADVANTAGE CARD ───────────────────────────────────────── */
.advantage-card {
  background: rgba(45, 138, 88, 0.05);
  border-color: rgba(45, 138, 88, 0.2);
}

.advantage-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.advantage-item {
  display: flex;
  gap: 16px;
}

.advantage-icon {
  width: 32px;
  height: 32px;
  background: var(--emerald-bright);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.advantage-content {
  flex: 1;
}

.advantage-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--platinum);
  margin-bottom: 8px;
}

.advantage-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ── DELIVERY FORM ────────────────────────────────────────── */
.delivery-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.form-input,
.form-textarea {
  background: rgba(229, 228, 226, 0.04);
  border: 1px solid var(--ghost-border);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--platinum);
  border-radius: 6px;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--emerald-bright);
}

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

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

/* ── TERMS CHECKBOXES ─────────────────────────────────────── */
.terms-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkbox-container {
  display: flex;
  gap: 12px;
  cursor: pointer;
  padding: 16px;
  background: rgba(229, 228, 226, 0.02);
  border: 1px solid var(--ghost-border);
  border-radius: 6px;
  transition: background 0.2s;
}

.checkbox-container:hover {
  background: rgba(229, 228, 226, 0.04);
}

.checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--ghost-border);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.checkbox-container input[type="checkbox"]:checked ~ .custom-checkbox {
  background: var(--emerald-bright);
  border-color: var(--emerald-bright);
}

.checkbox-container input[type="checkbox"]:checked ~ .custom-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.checkbox-label-content {
  flex: 1;
}

.label-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--platinum);
  display: block;
  margin-bottom: 4px;
}

.label-description {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  display: block;
}

.terms-link {
  color: var(--copper);
  text-decoration: none;
}

.terms-link:hover {
  text-decoration: underline;
}

/* ── PAYMENT ──────────────────────────────────────────────── */
.payment-summary {
  background: rgba(229, 228, 226, 0.04);
  border: 1px solid var(--ghost-border);
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 24px;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.balance-row {
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--ghost-border);
}

.payment-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.payment-value {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--copper);
  font-weight: 700;
}

.balance-row .payment-value {
  color: var(--platinum);
  font-size: 14px;
}

.payment-element-container {
  background: rgba(229, 228, 226, 0.04);
  border: 1px solid var(--ghost-border);
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.payment-errors {
  background: rgba(204, 68, 68, 0.1);
  border: 1px solid #cc4444;
  color: #ff6b6b;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.payment-footer {
  margin-top: 16px;
}

.payment-footer-text {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.6;
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--emerald-bright);
  color: white;
  border: none;
  padding: 14px 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: background 0.2s;
  border-radius: 6px;
  text-align: center;
}

.btn-primary:hover:not(:disabled) {
  background: var(--emerald-mid);
}

.btn-primary:disabled {
  background: rgba(229, 228, 226, 0.1);
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn-primary.btn-large {
  width: 100%;
  padding: 18px 32px;
  font-size: 12px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--copper);
  color: var(--copper);
  padding: 12px 28px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: var(--copper-dim);
}

/* ── FOOTER ───────────────────────────────────────────────── */
.portal-footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid var(--ghost-border);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.8;
}

.portal-footer a {
  color: var(--copper);
  text-decoration: none;
}

.portal-footer a:hover {
  text-decoration: underline;
}

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-card {
  animation: fadeUp 0.3s ease-out;
}
