/* =========================================================
   EL HOUFI CONSULT IN GROUP — Invoice Payment Portal
   Corporate / premium static styling
   Colors inspired by the logo: royal blue, dark navy, grey, white
   ========================================================= */

:root {
  --blue: #2f6bd0;          /* royal blue from logo */
  --blue-dark: #1d3f7a;     /* deep navy */
  --blue-darker: #14294f;
  --blue-soft: #eaf1fc;     /* light blue tint */
  --grey: #8a94a6;          /* neutral grey (logo leaf) */
  --grey-light: #f4f6fa;    /* light background */
  --grey-line: #e3e8f0;     /* borders */
  --text: #1f2733;
  --text-soft: #5c6675;
  --white: #ffffff;
  --green: #17a673;
  --amber: #b7791f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 41, 79, 0.06);
  --shadow: 0 6px 24px rgba(20, 41, 79, 0.08);
  --shadow-lg: 0 18px 50px rgba(20, 41, 79, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--grey-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ---------- Top bar / header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand img {
  height: 46px;
  width: auto;
  display: block;
}

.brand-name {
  font-weight: 700;
  color: var(--blue-dark);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand-name small {
  display: block;
  font-weight: 500;
  color: var(--grey);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #d5e2f7;
}
.secure-badge svg { width: 15px; height: 15px; }

/* ---------- Main layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ---------- Hero / page title ---------- */
.page-head {
  text-align: center;
  margin-bottom: 34px;
}
.page-head h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-darker);
  letter-spacing: -0.01em;
}
.page-head p {
  color: var(--text-soft);
  margin-top: 8px;
  font-size: 1.02rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.back-link:hover { color: var(--blue-dark); }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Trust block */
.trust-block {
  padding: 26px 28px;
  margin-bottom: 28px;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.trust-item .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey);
  font-weight: 600;
  margin-bottom: 4px;
}
.trust-item .value {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}
.trust-item .value.ref {
  color: var(--blue-dark);
  font-family: "Courier New", monospace;
  letter-spacing: 0.03em;
}

/* ---------- Invoice preview ---------- */
.invoice-section {
  padding: 26px 28px 30px;
}
.invoice-section h2 {
  font-size: 1.15rem;
  color: var(--blue-darker);
  margin-bottom: 4px;
}
.invoice-section .sub {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.pdf-frame {
  width: 100%;
  height: 620px;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius-sm);
  background: var(--grey-light);
  overflow: hidden;
}
.pdf-frame iframe,
.pdf-frame embed {
  width: 100%;
  height: 100%;
  border: 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
  align-items: center;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  line-height: 1;
}
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(47, 107, 208, 0.28);
}
.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(47, 107, 208, 0.32);
}

.btn-secondary {
  background: var(--white);
  color: var(--blue-dark);
  border-color: var(--grey-line);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-lg { padding: 16px 40px; font-size: 1.05rem; }

.btn-disabled,
.btn:disabled {
  background: var(--grey-light);
  color: var(--grey);
  border-color: var(--grey-line);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-disabled:hover { transform: none; }

/* ---------- Notices ---------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.notice svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.notice-info {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border: 1px solid #d5e2f7;
}
.notice-warn {
  background: #fdf6e7;
  color: var(--amber);
  border: 1px solid #f3e2b8;
}
.notice-muted {
  background: var(--grey-light);
  color: var(--text-soft);
  border: 1px solid var(--grey-line);
}

.security-strip {
  margin-top: 30px;
}

/* ---------- Payment method cards ---------- */
.methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 8px;
}

.method-card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.method-card.selectable { cursor: pointer; }
.method-card.selectable:hover {
  box-shadow: var(--shadow);
  border-color: #c9d7ee;
}
.method-card.active {
  border-color: var(--blue);
  box-shadow: var(--shadow-lg);
}
.method-card.disabled {
  opacity: 0.72;
}

.method-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
}
.method-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.method-icon svg { width: 26px; height: 26px; }
.method-icon.grey { background: var(--grey-light); color: var(--grey); }

.method-title-wrap { flex: 1; min-width: 0; }
.method-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.method-title h3 {
  font-size: 1.08rem;
  color: var(--blue-darker);
  font-weight: 700;
}
.method-desc {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin-top: 2px;
}

.tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 9px;
  border-radius: 999px;
}
.tag-reco { background: #e5f6ef; color: var(--green); }
.tag-unavail { background: #fdeceb; color: #c0392b; }
.tag-limited { background: #fdf6e7; color: var(--amber); }

.chevron {
  color: var(--grey);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.method-card.active .chevron { transform: rotate(180deg); }

/* card brand badges (local CSS/text — no external logos) */
.brand-logos { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 42px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 1px solid var(--grey-line);
  background: var(--grey-light);
  color: var(--text-soft);
}
.card-badge-visa {
  background: #eaf1fc;
  color: #1a3a8f;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}
.card-badge-amex {
  background: #eaf3fb;
  color: #016fd0;
}
.card-badge-mc {
  gap: 0;
  background: var(--grey-light);
  min-width: 42px;
  position: relative;
  padding: 0 10px;
}
.card-badge-mc i {
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  opacity: 0.9;
}
.card-badge-mc i:first-child {
  background: #eb001b;
  margin-right: -6px;
}
.card-badge-mc i:last-child {
  background: #f79e1b;
  mix-blend-mode: multiply;
}

/* Expandable panel */
.method-body {
  border-top: 1px solid var(--grey-line);
  padding: 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.method-card.active .method-body {
  padding: 22px;
  max-height: 1400px;
}

/* ---------- Bank details table ---------- */
.bank-details {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}
.bank-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--grey-line);
}
.bank-row:last-child { border-bottom: 0; }
.bank-row .k {
  background: var(--grey-light);
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bank-row .v {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text);
  font-family: "Courier New", monospace;
  word-break: break-all;
  display: flex;
  align-items: center;
}

/* ---------- Disabled card form (visual only) ---------- */
.card-form {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.card-preview {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-darker));
  color: var(--white);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card-preview::after {
  content: "";
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.card-chip {
  width: 42px; height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e6c66a, #c9a94a);
  margin-bottom: 22px;
}
.card-preview .cp-number {
  font-family: "Courier New", monospace;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}
.card-preview .cp-bottom {
  display: flex; justify-content: space-between; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.9;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}
.field input {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius-sm);
  background: var(--grey-light);
  color: var(--grey);
}
.field input:disabled { cursor: not-allowed; }

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--blue-darker);
  color: var(--white);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 17px; height: 17px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--grey-line);
  padding: 26px 24px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.site-footer strong { color: var(--blue-dark); font-weight: 700; }
.site-footer .official {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--grey);
  font-size: 0.8rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .trust-grid { grid-template-columns: 1fr; gap: 16px; }
  .page-head h1 { font-size: 1.55rem; }
  .pdf-frame { height: 460px; }
  .bank-row { grid-template-columns: 1fr; }
  .bank-row .k { border-bottom: 1px solid var(--grey-line); }
  .field-row { grid-template-columns: 1fr; }
  .action-row .btn { flex: 1 1 100%; }
  .header-inner { padding: 12px 16px; }
  .brand-name { font-size: 0.85rem; }
  main { padding: 28px 16px 48px; }
}

@media (max-width: 480px) {
  .method-head { flex-wrap: wrap; }
  .brand-logos { order: 3; width: 100%; }
  .secure-badge span { display: none; }
}
