/* ═══════════════════════════════════════════════════════════
   pay.css  |  Pay for Invoice page
   Inherits site design tokens from styles.css but is loaded
   exclusively on pay.html — no conflicts possible.
   ═══════════════════════════════════════════════════════════ */

/* ─── Page layout ──────────────────────────────────────────*/
.page--pay {
  background: var(--bg-surface);
  min-height: 100vh;
}

/* Fixed nav on pay page (mirrors .page--application rule) */
.page--pay .nav {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  box-shadow: var(--shadow-xs);
}

/* ─── Pay Hero ──────────────────────────────────────────── */
.pay-hero {
  background: var(--bg-dark);
  padding: calc(var(--nav-height) + 56px) 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pay-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% -10%, rgba(217, 95, 0, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.pay-hero .container {
  position: relative;
  z-index: 1;
}

.pay-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: rgba(217, 95, 0, 0.12);
  border: 1px solid rgba(217, 95, 0, 0.25);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
  animation: fadeDown 0.55s ease both;
}

.pay-hero__title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 16px;
  animation: fadeUp 0.65s ease 0.08s both;
}

.pay-hero__title .accent-text {
  color: var(--brand);
}

.pay-hero__sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.62);
  max-width: 440px;
  margin: 0 auto 0;
  line-height: 1.7;
  animation: fadeUp 0.65s ease 0.16s both;
}

/* ─── Pay Body ──────────────────────────────────────────── */
.pay-body {
  padding: 56px 0 100px;
}

.pay-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 48px;
  align-items: start;
}

/* ─── Info Column ───────────────────────────────────────── */
.pay-info {
  padding-top: 8px;
}

.pay-info__header {
  margin-bottom: 32px;
}

.pay-info__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 10px;
  letter-spacing: -0.025em;
}

.pay-info__desc {
  font-size: 0.9375rem;
  color: var(--text-body);
  line-height: 1.7;
  max-width: 400px;
}

.pay-trust {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 36px;
}

.pay-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.pay-trust__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.pay-trust__text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 2px;
}

.pay-trust__text p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Stripe badge */
.pay-stripe-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
}

.pay-stripe-badge svg {
  display: inline-block;
  flex-shrink: 0;
}

/* ─── Payment Card ──────────────────────────────────────── */
.pay-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.pay-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), #FF8C3B);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.pay-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.pay-card__sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ─── Form fields ───────────────────────────────────────── */
.pay-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pay-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pay-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.pay-field label .pay-field__required {
  color: var(--brand);
  margin-left: 2px;
}

.pay-field input {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.9375rem;
  color: var(--text-heading);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
}

.pay-field input::placeholder {
  color: var(--text-light);
}

.pay-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 95, 0, 0.1);
}

.pay-field input.error {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.pay-field__error {
  font-size: 0.78rem;
  color: #e53935;
  min-height: 1em;
  line-height: 1.4;
}

/* Amount field with prefix */
.pay-field--amount .pay-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pay-field--amount .pay-field__prefix {
  position: absolute;
  left: 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
}

.pay-field--amount input {
  padding-left: 34px;
}

/* Row layout for two fields side-by-side */
.pay-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ─── Stripe card element ───────────────────────────────── */
.pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.pay-divider__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.pay-divider__text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pay-stripe-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pay-stripe-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.stripe-element {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 44px;
}

.stripe-element--focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(217, 95, 0, 0.1);
}

.stripe-element--error {
  border-color: #e53935;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

.pay-card-error {
  font-size: 0.78rem;
  color: #e53935;
  min-height: 1em;
  line-height: 1.4;
}

/* ─── Order summary ─────────────────────────────────────── */
.pay-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.pay-summary__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-body);
}

.pay-summary__label span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.pay-summary__amount {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.025em;
}

.pay-summary__amount--empty {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ─── Submit button ─────────────────────────────────────── */
.pay-submit {
  margin-top: 4px;
}

.btn--pay {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.btn--pay:hover:not(:disabled) {
  background: var(--brand-hover);
  box-shadow: 0 6px 20px rgba(217,95,0,0.28);
  transform: translateY(-1px);
}

.btn--pay:active:not(:disabled) {
  transform: scale(0.98) translateY(0);
}

.btn--pay:disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Lock icon */
.btn--pay__lock {
  opacity: 0.7;
  flex-shrink: 0;
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ─── Status states ─────────────────────────────────────── */
.pay-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 4px;
  gap: 16px;
}

.pay-status__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.pay-status__icon--success {
  background: #ecfdf5;
  color: #059669;
}

.pay-status__icon--error {
  background: #fef2f2;
  color: #e53935;
}

.pay-status__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.pay-status__desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 300px;
}

.pay-status__retry {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pay-status__retry:hover { color: var(--brand-hover); }

/* ─── Footer note ───────────────────────────────────────── */
.pay-footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 14px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .pay-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .pay-info {
    order: 2;
    padding-top: 0;
  }

  .pay-card {
    order: 1;
  }

  .pay-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
}

@media (max-width: 560px) {
  .pay-hero {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 44px;
  }

  .pay-body {
    padding: 36px 0 72px;
  }

  .pay-card {
    padding: 28px 22px;
  }

  .pay-field-row {
    grid-template-columns: 1fr;
  }

  .pay-trust {
    grid-template-columns: 1fr;
  }
}
