/* ============================================================
   EC Phone-Sales Checkout — ported from the approved mockups
   Palette: navy #272E6D, blue #0E71B8, green #10B981
   ============================================================ */

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

body {
  font-family: 'Nunito', sans-serif;
  background: #F8FAFC;
  color: #272E6D;
}
::selection { background: #0E71B8; color: #fff; }

.ec-page { min-height: 100dvh; display: flex; flex-direction: column; }

/* Hello bar */
.ec-hellobar { background: #272E6D; color: #fff; padding: 8px 16px; text-align: center; }
.ec-hellobar p { font-size: 0.8125rem; font-weight: 700; line-height: 1.375; }
.ec-livedot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #10B981; margin-right: 8px; vertical-align: middle;
  animation: ec-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes ec-pulse { 50% { opacity: .5; } }

/* Header */
.ec-header {
  background: #fff; border-bottom: 1px solid #F1F5F9; padding: 12px 24px;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 10px 40px -10px rgba(39,46,109,0.08);
}
.ec-logo { height: 32px; object-fit: contain; }
.ec-callpill {
  display: flex; align-items: center; gap: 12px; background: #F8FAFC;
  padding: 6px 16px 6px 6px; border-radius: 9999px; border: 1px solid #E2E8F0;
}
.ec-callpill-avatar { position: relative; display: block; }
.ec-callpill-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; }
.ec-online {
  position: absolute; bottom: 0; right: -2px; width: 10px; height: 10px;
  background: #10B981; border: 1.5px solid #fff; border-radius: 50%;
}
.ec-callpill span[class^="ec-callpill-text"] { font-size: 0.8125rem; font-weight: 700; color: #334155; }
.ec-callpill-text-short { display: none; }
@media (max-width: 640px) {
  .ec-callpill-text-full { display: none !important; }
  .ec-callpill-text-short { display: inline !important; }
}

/* Main */
.ec-main { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 32px; }
.ec-content { width: 100%; display: flex; flex-direction: column; align-items: center; animation: ec-fadein .5s ease both; }
@keyframes ec-fadein { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Steps */
.ec-steps { width: 100%; max-width: 280px; margin: 0 auto 32px; display: flex; justify-content: space-between; position: relative; padding: 0 8px; }
.ec-steps-track {
  position: absolute; left: 0; top: 12px; width: 100%; height: 4px;
  background: #E2E8F0; border-radius: 9999px; overflow: hidden; z-index: 0;
}
.ec-steps-fill { height: 100%; background: #0E71B8; border-radius: 9999px; transition: width .7s ease-out; }
.ec-step { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #F8FAFC; padding: 0 8px; z-index: 1; }
.ec-step-dot {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 900; background: #E2E8F0; color: #64748B;
}
.ec-step.is-active .ec-step-dot { background: #0E71B8; color: #fff; }
.ec-step-label { font-size: 0.625rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; color: #94A3B8; }
.ec-step.is-active .ec-step-label { color: #272E6D; }

/* Footer */
.ec-footer { padding: 24px 0; text-align: center; margin-top: auto; display: flex; justify-content: center; }
.ec-securebadge {
  display: flex; align-items: center; gap: 8px; color: #272E6D; font-weight: 700;
  background: #fff; padding: 8px 16px; border-radius: 8px; font-size: 0.8125rem;
  box-shadow: 0 10px 40px -10px rgba(39,46,109,0.08); border: 1px solid rgba(226,232,240,0.5);
}

/* Shared bits */
.ec-shadow { box-shadow: 0 10px 40px -10px rgba(39,46,109,0.08); }
.ec-card { background: #fff; border-radius: 12px; border: 1px solid #F1F5F9; box-shadow: 0 10px 40px -10px rgba(39,46,109,0.08); }

.ec-input {
  border: 2px solid #E2E8F0; border-radius: 8px; padding: 0 1rem; width: 100%;
  transition: border-color .2s, box-shadow .2s; color: #272E6D; font-weight: 700;
  font-size: 1rem; height: 52px; font-family: inherit; background: #fff;
}
.ec-input::placeholder { color: #94A3B8; font-weight: 600; }
.ec-input:focus { outline: none; border-color: #0E71B8; box-shadow: 0 0 0 3px rgba(14,113,184,0.15); }
.ec-input.mono { font-family: ui-monospace, monospace; letter-spacing: 0.1em; }

.ec-button {
  color: #fff; font-weight: 800; font-size: 1.125rem; padding: 0 2rem; border-radius: 8px;
  transition: all .2s; width: 100%; display: flex; justify-content: center; align-items: center;
  gap: 8px; line-height: 1.2; height: 56px; border: none; cursor: pointer; font-family: inherit;
  background: #0E71B8;
}
.ec-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px -6px rgba(14,113,184,0.4); background: #0c619e; }
.ec-button:active:not(:disabled) { transform: none; box-shadow: 0 2px 8px -4px rgba(14,113,184,0.3); }
.ec-button:disabled { opacity: .6; cursor: not-allowed; filter: grayscale(80%); }
.ec-button.green { background: #10B981; box-shadow: 0 10px 24px -8px rgba(16,185,129,0.5); }
.ec-button.green:hover:not(:disabled) { background: #0da271; box-shadow: 0 10px 24px -8px rgba(16,185,129,0.5); }

.ec-label { display: block; font-size: 0.875rem; font-weight: 900; color: #272E6D; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }

h1.ec-h1 { font-size: 2rem; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; margin-bottom: 8px; }
@media (min-width: 768px) { h1.ec-h1 { font-size: 2.25rem; } }
.ec-sub { font-size: 1.125rem; color: #475569; line-height: 1.5; font-weight: 700; text-wrap: balance; }

.ec-note { text-align: center; font-size: 0.8125rem; font-weight: 700; color: #64748B; margin-top: 12px; }
.ec-error {
  background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C; font-weight: 700;
  border-radius: 8px; padding: 12px 16px; font-size: 0.9375rem; margin-bottom: 16px;
}

/* Welcome */
.ec-welcome { max-width: 560px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 32px 16px; }
.ec-welcome h1 { font-size: 2.75rem; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; }
@media (min-width: 768px) { .ec-welcome h1 { font-size: 3.25rem; } }
.ec-welcome .ec-intro { font-size: 1.1875rem; color: #475569; font-weight: 700; line-height: 1.5; max-width: 480px; text-wrap: balance; }
.ec-welcome .ec-cta-lead { font-size: 1.0625rem; font-weight: 900; }
.ec-livecard { width: 100%; max-width: 440px; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid #E2E8F0; box-shadow: 0 16px 36px -14px rgba(39,46,109,0.18); margin-top: 8px; }
.ec-livecard-head { display: flex; align-items: center; justify-content: center; gap: 8px; background: #FEF2F2; padding: 8px; border-bottom: 1px solid #FECACA; }
.ec-livecard-head .dot { position: relative; display: inline-flex; width: 10px; height: 10px; }
.ec-livecard-head .dot::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #EF4444; opacity: .75; animation: ec-ping 1.2s cubic-bezier(0,0,0.2,1) infinite; }
.ec-livecard-head .dot::after { content: ''; position: relative; display: block; width: 10px; height: 10px; border-radius: 50%; background: #EF4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.3); }
@keyframes ec-ping { 75%, 100% { transform: scale(2); opacity: 0; } }
.ec-livecard-head span.txt { font-size: 0.75rem; font-weight: 900; letter-spacing: 0.25em; color: #B91C1C; }
.ec-livecard p { font-size: 0.9375rem; font-weight: 700; line-height: 1.375; text-align: center; padding: 16px 24px; text-wrap: balance; }

/* Forms / cards */
.ec-formwrap { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 24px; }
.ec-formwrap .head { text-align: center; padding: 0 16px; }
.ec-card-pad { padding: 24px; }
@media (min-width: 768px) { .ec-card-pad { padding: 32px; } }
.ec-field { margin-bottom: 20px; }
.ec-grid2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .ec-grid2 { grid-template-columns: 1fr 1fr; } }

/* On-file rows (email / mobile) */
.ec-onfile { border-radius: 12px; background: #F8FAFC; border: 1px solid #E2E8F0; padding: 0 16px; margin-bottom: 20px; }
.ec-onfile-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.ec-onfile-row + .ec-onfile-row { border-top: 1px solid #E2E8F0; }
.ec-onfile-row .lbl { font-size: 0.75rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 2px; }
.ec-onfile-row .val { font-size: 1rem; font-weight: 700; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-onfile-row .grow { min-width: 0; flex: 1; }
.ec-onfile-row .val input { height: 44px; }
.ec-editbtn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-weight: 900;
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.03em; border-radius: 8px;
  padding: 8px 12px; color: #0E71B8; background: transparent; border: none; cursor: pointer; font-family: inherit;
}
.ec-editbtn:hover { background: rgba(14,113,184,0.1); }

/* Social proof */
.ec-proof { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; color: #64748B; font-weight: 700; font-size: 0.875rem; padding: 0 16px; text-align: center; }
.ec-stars { color: #FFCD02; letter-spacing: 2px; font-size: 1rem; }

/* Payment */
.ec-duetoday { background: #F8FAFC; padding: 24px 32px; border-bottom: 1px solid #E2E8F0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.ec-duetoday .lbl { font-size: 0.8125rem; font-weight: 900; color: #64748B; text-transform: uppercase; letter-spacing: 0.1em; display: block; }
.ec-duetoday .amt { font-size: 2.5rem; font-weight: 900; color: #10B981; line-height: 1; }
@media (min-width: 768px) { .ec-duetoday .amt { font-size: 3rem; } }
.ec-duetoday .then { font-size: 0.875rem; font-weight: 700; color: #475569; line-height: 1.4; max-width: 240px; }
.ec-trustgrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .ec-trustgrid { grid-template-columns: 1fr 1fr; } }
.ec-trustcard { background: rgba(16,185,129,0.08); border-radius: 12px; border: 1px solid rgba(16,185,129,0.2); padding: 20px 24px; }
.ec-trustcard .tc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ec-trustcard .tc-icon { width: 32px; height: 32px; border-radius: 50%; background: rgba(16,185,129,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #1F7A3D; font-weight: 900; }
.ec-trustcard h4 { font-weight: 900; color: #1F7A3D; font-size: 1rem; letter-spacing: -0.01em; }
.ec-trustcard p { font-size: 0.875rem; color: #334155; font-weight: 700; line-height: 1.4; }

/* Confirm */
.ec-summary { margin-bottom: 16px; overflow: hidden; }
.ec-sumrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 14px 20px; }
.ec-sumrow + .ec-sumrow { border-top: 1px solid #F1F5F9; }
.ec-sumrow .k { font-size: 0.875rem; color: #64748B; font-weight: 700; }
.ec-sumrow .v { font-size: 1rem; font-weight: 900; text-align: right; }
.ec-sumrow.hl { background: rgba(16,185,129,0.05); }
.ec-sumrow.hl .v { color: #10B981; font-size: 1.125rem; }
.ec-agree {
  display: flex; align-items: flex-start; gap: 16px; padding: 20px; border-radius: 12px;
  border: 2px solid #E2E8F0; background: #F8FAFC; cursor: pointer; user-select: none; margin-bottom: 16px;
  transition: all .2s;
}
.ec-agree:hover { border-color: #CBD5E1; }
.ec-agree.checked { border-color: #0E71B8; background: rgba(14,113,184,0.05); }
.ec-agree input { display: none; }
.ec-agree .box {
  flex-shrink: 0; margin-top: 2px; width: 24px; height: 24px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; background: #E2E8F0;
  color: transparent; font-weight: 900; transition: all .2s;
}
.ec-agree.checked .box { background: #0E71B8; color: #fff; }
.ec-agree p { font-weight: 700; font-size: 1rem; line-height: 1.5; color: #475569; }
.ec-agree.checked p { color: #272E6D; }
.ec-green-note { text-align: center; font-size: 0.8125rem; font-weight: 900; color: #1F7A3D; margin-top: 8px; letter-spacing: -0.01em; }

/* Thank you */
.ec-tick {
  width: 80px; height: 80px; background: #10B981; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 2.5rem; font-weight: 900;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); animation: ec-pop .5s cubic-bezier(0.34,1.56,0.64,1) both;
  margin: 0 auto;
}
@keyframes ec-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Locked */
.ec-lockicon {
  width: 80px; height: 80px; border-radius: 16px; background: #E2E8F0; display: flex;
  align-items: center; justify-content: center; transform: rotate(-3deg); margin: 0 auto;
}
.ec-phonecard {
  width: 100%; max-width: 440px; background: #fff; border-radius: 16px; border: 1px solid #E2E8F0;
  box-shadow: 0 10px 40px -10px rgba(39,46,109,0.08); padding: 20px 24px;
  display: flex; align-items: flex-start; gap: 16px; text-align: left; margin: 0 auto;
}
.ec-phonecard .icon {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(14,113,184,0.1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ec-phonecard p { font-size: 0.9375rem; font-weight: 700; line-height: 1.375; }

/* Loading overlay */
.ec-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: rgba(248,250,252,0.92); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.ec-overlay.visible { opacity: 1; pointer-events: all; }
.ec-overlay-spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px solid #E2E8F0; border-top-color: #0E71B8;
  animation: ec-spin .8s linear infinite;
}
@keyframes ec-spin { to { transform: rotate(360deg); } }
.ec-overlay-msg {
  font-size: 1.0625rem; font-weight: 900; color: #272E6D;
  letter-spacing: -0.01em; text-align: center; padding: 0 24px;
}
.ec-overlay-sub {
  font-size: 0.875rem; font-weight: 700; color: #64748B;
  text-align: center; padding: 0 24px; margin-top: -16px;
}

/* Confetti */
.ec-confetti { pointer-events: none; position: fixed; inset: 0; overflow: hidden; }
.ec-confetti span { position: absolute; top: -3vh; animation: ec-confetti-fall linear infinite; }
@keyframes ec-confetti-fall {
  0% { transform: translateY(-6vh) translateX(0) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(106vh) translateX(var(--drift)) rotate(var(--spin)); opacity: 0; }
}
