/* Shared frosted surfaces for both HTML routes and React pages.
   Reference: glass-cards-crm. Keep text opaque and tables legible. */
:root {
  --brand-jade: #237c68;
  --frost-fill: color-mix(in srgb, var(--surface) 68%, transparent);
  --frost-row: color-mix(in srgb, var(--surface) 76%, white 5%);
  --frost-line: rgba(255,255,255,.19);
  --frost-edge: rgba(255,255,255,.23);
  --frost-halo: color-mix(in srgb, var(--accent) 14%, transparent);
  --frost-shadow: rgba(0,0,0,.18);
}
html body :is(.brand-mark,.oc-mark){background-color:var(--brand-jade)!important}
html[data-theme="light"] {
  --frost-fill: rgba(255,255,255,.61);
  --frost-row: rgba(255,255,255,.55);
  --frost-line: rgba(255,255,255,.86);
  --frost-edge: rgba(255,255,255,.95);
  --frost-halo: color-mix(in srgb, var(--accent) 11%, transparent);
  --frost-shadow: rgba(24,53,75,.08);
}
html body :is(.loan-card,.form-card,.info-card,.auth-card,.auth-real-card,
  .hero-preview,.auth-card-shell,.estimate-card,.calc-panel,.calc-result-inner,.testi-card,.stat-card,.panel,.admin-record,
  .admin-menu,.admin-today,.admin-kpis>div,.admin-account-cards>*,
  .admin-loan-list article,.cta-scene,.comparison,.empty) {
  background: linear-gradient(145deg,var(--frost-edge) -100%,transparent 52%),
    radial-gradient(ellipse at 100% 0,var(--frost-halo),transparent 68%),var(--frost-fill);
  border: 1px solid var(--frost-line);
  border-radius: 26px;
  box-shadow: inset 0 1px 1px var(--frost-edge),inset 0 -1px 1px rgba(255,255,255,.06),
    0 12px 32px -16px var(--frost-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
  backdrop-filter: blur(24px) saturate(125%);
  color: var(--text);
}
html body :is(.loan-card,.info-card,.testi-card){border-start-start-radius:42px}
html body :is(.loan-card h2,.loan-card h3,.info-card h2,.panel-head h2){font-weight:500;letter-spacing:0}
html body .loan-card::before{opacity:.32}
html body .loan-card .loan-facts{display:grid;grid-template-columns:1fr;gap:8px}
/* Keep native definition labels available to assistive technology. */
html body .loan-facts dt{display:block;position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html body .loan-card .loan-facts dd {
  padding:10px 18px;border-radius:24px;background:var(--frost-row);
  border:1px solid var(--frost-line);box-shadow:inset 0 1px 2px var(--frost-edge);
  color:var(--text);font-size:.93rem;line-height:1.8;
}
html body .loan-card .loan-facts dd::before{color:var(--text-muted);font-size:.75rem}
html body .loan-card .loan-facts dd:nth-of-type(4){border-style:solid}
html body :is(.admin-today li a,.admin-menu nav a,.admin-section-tabs a,.glass-steps li) {
  background:var(--frost-row);border:1px solid var(--frost-line);
  border-radius:24px;box-shadow:inset 0 1px 1px var(--frost-edge);
}
html body .deal-list{border:0;background:transparent;box-shadow:none}
html body .deal-row {
  margin-block:8px;border:1px solid var(--frost-line);border-radius:20px;
  background:var(--frost-fill);box-shadow:inset 0 1px 1px var(--frost-edge);
}
html body .deal-row:hover{background:color-mix(in srgb,var(--accent) 9%,var(--surface))}
html body .estimate-summary{background:var(--frost-row)}
html body .process-list{gap:10px;border:0;background:transparent;overflow:visible}
html body .process-list li{background:var(--frost-fill);border:1px solid var(--frost-line)!important;border-radius:24px;box-shadow:inset 0 1px 1px var(--frost-edge)}
/* Sculpted process cards: raised tab, inset icon and a short reading path. */
html body .process-section .section-head h2{font-size:clamp(22px,2.4vw,30px);font-weight:500}
html body .process-list{gap:16px;padding-top:14px}
html body .process-list li{
  position:relative;display:flex;flex-direction:column;gap:20px;padding:22px;
  border-start-start-radius:12px;border-start-end-radius:38px;
  background:linear-gradient(150deg,var(--frost-edge) -70%,transparent 65%),var(--frost-fill);
  backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);
  box-shadow:inset 0 1px 2px var(--frost-edge),0 16px 32px -24px var(--frost-shadow);
}
html body .process-list li::before{
  content:"";position:absolute;top:-12px;inset-inline-start:-1px;width:42%;height:14px;
  background:var(--frost-fill);border:1px solid var(--frost-line);border-bottom:0;
  border-radius:15px 24px 0 0;pointer-events:none;
}
.process-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
html body .process-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:16px;background:var(--frost-row);border:1px solid var(--frost-line);box-shadow:inset 0 1px 2px var(--frost-edge);color:var(--accent)}
.process-icon svg{width:24px;height:24px}
html body .process-number{margin:0;padding:0;font-size:11px;font-weight:500;color:var(--text-muted)}
html body .process-list h3{font-size:17px;font-weight:500;margin:0 0 8px}
html body .process-list p{font-size:13px;line-height:1.85}
/* The opening sample now uses the same frosted material as the real tool. */
html body .hero-preview{position:relative;padding:28px;border-start-start-radius:44px;max-width:430px;margin-inline:auto}
html body .hero-preview dl{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-block:20px}
html body .hero-preview dl>div{display:grid;gap:5px;padding:12px 16px;border:1px solid var(--frost-line);border-radius:20px;background:var(--frost-row);box-shadow:inset 0 1px 1px var(--frost-edge)}
html body .hero-preview dl>div:first-child{grid-column:1/-1}
html body .hero-preview dt{font-size:11px;color:var(--text-muted)}
html body .hero-preview dd{margin:0;font-size:15px;font-weight:500}
html body .hero-preview .hp-value{font-size:clamp(28px,3vw,38px);font-weight:500;letter-spacing:0;margin-block:8px 20px}
html body .hero-preview .minor{font-size:11px;line-height:1.9;margin-top:14px}
/* Compact catalog: two small facts, one full-width rate, details on demand. */
html body .catalog-grid{align-items:start;gap:16px}
html body .catalog-grid .loan-card{padding:20px;gap:0}
html body .catalog-grid .loan-card>.minor{margin:12px 0 3px;font-size:11px}
html body .catalog-grid .loan-card .loan-name{font-size:19px;margin:0 0 14px;font-weight:500}
html body .catalog-grid .loan-card .badge{font-size:10px;padding:3px 9px}
html body .catalog-grid .loan-card .loan-facts{grid-template-columns:1fr 1fr!important;gap:7px}
html body .catalog-grid .loan-card .loan-facts dd{grid-column:auto!important;padding:8px 12px;border-radius:18px;font-size:13px;line-height:1.8}
html body .catalog-grid .loan-card .loan-facts dd:nth-of-type(3){grid-column:1/-1!important}
html body .catalog-grid .loan-card .loan-facts dd::before{font-size:10px}
html body .loan-extra{font-size:12px;line-height:1.9;margin-block:12px 0}
html body .loan-extra summary{cursor:pointer;color:var(--text-muted);padding-block:6px;min-height:32px}
html body .catalog-grid .loan-card .form-actions{padding-top:12px;gap:8px}
html body .catalog-grid .loan-card .form-actions :is(a,button){font-size:11px;padding:9px 12px;min-height:40px}
/* Put the glass on the outer login card, not on each nested form. */
html body .auth-wrap{background:radial-gradient(ellipse at 30% 30%,var(--frost-halo),transparent 64%);padding:44px 18px 64px}
html body .auth-card-shell{padding:28px;border-start-start-radius:44px;gap:18px}
html body .auth-card-shell h1{font-size:25px;font-weight:500}
html body .auth-card-shell>.minor{font-size:12px;line-height:1.95}
html body .auth-card-shell .auth-card{background:transparent;border:0;box-shadow:none;padding:0;backdrop-filter:none;-webkit-backdrop-filter:none;border-radius:0}
html body .auth-card-shell :is(input,select){background:var(--frost-row);border:1px solid var(--frost-line);border-radius:18px;padding:12px 16px;color:var(--text);box-shadow:inset 0 1px 1px var(--frost-edge)}
html body .auth-card-shell .btn{border-radius:20px}
html body .calc-result{background:transparent;border:0;box-shadow:none}
html body .calc-result-inner{padding:26px;border-start-start-radius:42px}
html body .calc-panel{border-start-start-radius:42px}
html body .calc-breakdown{display:grid;gap:8px}
html body .brk-item{padding:10px 14px;background:var(--frost-row);border:1px solid var(--frost-line);border-radius:20px;box-shadow:inset 0 1px 1px var(--frost-edge)}
html body .estimate-summary dl>div{padding:10px 14px;background:var(--frost-row);border:1px solid var(--frost-line);border-radius:18px;margin-block:7px}
html body :is(.loan-card,.form-card,.calc-panel,.estimate-card) :is(input,select,textarea){color:var(--text)}
html body :is(a,button,input,select,textarea,summary):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:700px){
  html body :is(.loan-card,.form-card,.info-card,.auth-card,.estimate-card,.calc-panel,.admin-record){border-radius:22px}
  html body .loan-card{padding:20px}
  html body .process-list li{padding:18px}
  html body .process-list{grid-template-columns:1fr 1fr;gap:22px 12px}
  html body .process-list li{gap:14px}
  html body .process-list h3{font-size:15px}
  html body .process-icon{width:36px;height:36px;border-radius:13px}
  html body .process-number{font-size:10px}
}
@media(max-width:380px){html body .process-list{grid-template-columns:1fr}}
/* Flip cards keep a stable front height; long conditions scroll on the back. */
html body .catalog-grid .loan-flip{
  padding:0;background:transparent;border:0;box-shadow:none;
  backdrop-filter:none;-webkit-backdrop-filter:none;overflow:visible;perspective:1200px;
}
html body .loan-flip::before{display:none}
.loan-flipper{position:relative;transform-style:preserve-3d;transition:transform .58s cubic-bezier(.2,.7,.2,1)}
.is-flipped .loan-flipper{transform:rotateY(180deg)}
html body .loan-face{
  display:flex;flex-direction:column;padding:20px;border:1px solid var(--frost-line);
  border-radius:26px 38px 26px 26px;backface-visibility:hidden;-webkit-backface-visibility:hidden;
  background:radial-gradient(ellipse at 100% 0,var(--frost-halo),transparent 70%),var(--frost-fill);
  box-shadow:inset 0 1px 2px var(--frost-edge),0 14px 32px -22px var(--frost-shadow);
  backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
}
.loan-face-front{min-height:330px}
html body .loan-face-back{position:absolute;inset:0;transform:rotateY(180deg);min-height:0}
.loan-back-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--frost-line)}
.loan-back-head h3{font-size:16px;font-weight:500;margin:0}
.loan-flip-back{flex-shrink:0;color:var(--accent);font-size:11px;padding:8px;border-radius:12px;min-height:40px}
.loan-back-copy{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-block:12px;font-size:12px;line-height:1.95;scrollbar-width:thin}
.loan-back-copy h4{font-size:12px;font-weight:600;margin:12px 0 6px}
.loan-back-copy ul{padding-inline-start:18px;list-style:disc}
.loan-back-copy li+li{margin-top:8px}
html body .loan-flip .form-actions{margin-top:auto;flex-wrap:wrap}
@media(prefers-reduced-motion:reduce){.loan-flipper{transition:none}}
.admin-day-summary,.admin-optional{border:1px solid var(--frost-line);border-radius:18px;background:var(--frost-fill);margin-block:16px;padding:12px 16px}
.admin-day-summary>summary,.admin-optional>summary{cursor:pointer;font-size:13px;font-weight:500;color:var(--text-muted);min-height:32px;line-height:2}
.admin-day-summary[open]>summary,.admin-optional[open]>summary{color:var(--accent);margin-bottom:12px}
.admin-optional .form-grid{margin-block:12px 0}
.case-tabs{display:flex;flex-wrap:wrap;gap:6px}
.case-tabs button{padding:9px 14px;border:1px solid var(--frost-line);border-radius:14px;background:var(--frost-row);color:var(--text-muted);font-size:12px;min-height:40px}
.case-tabs button[aria-pressed=true]{background:var(--accent);color:var(--bg);border-color:var(--accent)}
.case-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:16px;align-items:start}
.case-mini-card{padding:18px;border:1px solid var(--frost-line);border-radius:24px;background:radial-gradient(ellipse at 100% 0,var(--frost-halo),transparent 70%),var(--frost-fill);box-shadow:inset 0 1px 1px var(--frost-edge);min-width:0}
.case-mini-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.case-avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:var(--frost-row);color:var(--accent);font-size:16px}
.case-mini-card h3{font-size:17px;font-weight:500;margin:12px 0 3px;overflow-wrap:anywhere}
.case-contract{color:var(--text-muted);font-size:10px}
.case-plan{font-size:12px;line-height:1.8;margin-block:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.case-mini-money{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-block:12px}
.case-mini-money div{padding:8px 10px;border-radius:14px;background:var(--frost-row)}
.case-mini-money dt{font-size:10px;color:var(--text-muted)}
.case-mini-money dd{font-size:12px;margin:5px 0 0;line-height:1.7;overflow-wrap:anywhere}
.case-stage{font-size:11px;color:var(--text-muted);line-height:1.8;min-height:20px}
.case-mini-card footer{display:flex;gap:8px;align-items:flex-start;justify-content:space-between;margin-top:14px}
.case-mini-card footer>.btn{font-size:12px;min-height:40px;padding:8px 14px;border-radius:14px}
.record-action-menu>summary{cursor:pointer;padding:8px 12px;min-height:40px;font-size:12px;border:1px solid var(--frost-line);border-radius:14px;list-style:none}
.record-action-menu .form-actions{display:grid;gap:4px;margin-top:8px}
.record-action-menu .btn{font-size:11px;min-height:36px;padding:6px 10px}
.case-mini-card .record-action-form{padding:12px;margin-top:12px;border-radius:16px}
.case-mini-card:has(.record-action-form){grid-column:1/-1}
.case-mini-card.is-cancelled .case-avatar{color:var(--text-muted)}
@media(max-width:1000px){.case-card-grid{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.case-card-grid{grid-template-columns:1fr}.case-mini-card{padding:16px}.case-tabs button{flex:1}}
html body .apply-card{padding:24px;max-width:100%}
html body .apply-card .steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px;padding:0;list-style:none}
html body .apply-card .steps li{flex:1;padding:10px 14px;font-size:12px;border:1px solid var(--frost-line);border-radius:18px;background:var(--frost-row);white-space:nowrap}
html body .apply-card .steps li[aria-current=step]{color:var(--accent);border-color:var(--accent)}
html body .apply-card .plan-choice{border:0;padding:0;min-width:0}
html body .apply-card .plan-choice legend{font-size:20px;font-weight:500;margin-bottom:20px}
html body .apply-card .plan-search{display:grid;background:none;border:0;padding:0;max-width:420px;margin-bottom:18px}
.plan-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
html body .apply-card label.plan-option{display:flex;align-items:flex-start;gap:10px;padding:18px;margin:0;border:1px solid var(--frost-line);border-radius:24px;background:var(--frost-row);box-shadow:inset 0 1px 1px var(--frost-edge);cursor:pointer;min-width:0}
html body .apply-card label.plan-option.is-selected{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--surface))}
html body .plan-option input[type=radio]{width:18px;height:18px;min-height:18px;padding:0;margin-top:5px;flex-shrink:0;accent-color:var(--accent)}
.plan-option-content{display:grid;gap:7px;min-width:0}
.plan-option-bank{font-size:10px;color:var(--text-muted)}
.plan-option-content strong{font-size:15px;font-weight:500}
.plan-option-amount{font-size:12px;color:var(--accent)}
.plan-option-rate{font-size:11px;line-height:1.8;color:var(--text-muted)}
.own-origin,.own-terms{display:flex;gap:8px;flex-wrap:wrap}
html body .own-origin button,html body .own-terms button{margin:0;padding:8px 13px;min-height:36px;border-radius:14px;background:var(--frost-row);color:var(--text);border:1px solid var(--frost-line);font-size:12px}
html body .own-origin button[aria-pressed=true],html body .own-terms button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}
html body .own-loan-cards{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:20px}
html body .own-loan-cards .loan-card{padding:18px;border-radius:22px}
html body .own-loan-cards h2{font-size:20px;font-weight:500;overflow-wrap:anywhere}
.own-loan-row{width:100%;display:grid;gap:8px;text-align:start;background:none;color:var(--text);padding:8px 0}
.own-loan-row small{color:var(--text-muted);line-height:1.9}
.own-loan-detail{margin-top:16px}
.own-pay{display:grid;gap:6px;min-width:170px}
@media(max-width:900px){.plan-choice-grid{grid-template-columns:1fr 1fr}html body .own-loan-cards{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.plan-choice-grid{grid-template-columns:1fr}html body .apply-card{padding:18px}html body .apply-card .steps li{flex:auto}html body .own-loan-cards h2{font-size:17px}}
@supports not (backdrop-filter:blur(1px)){
  html body :is(.loan-card,.form-card,.auth-card,.estimate-card,.calc-panel,.panel,.admin-record,.deal-row){background:var(--surface)}
}
@media(prefers-reduced-transparency:reduce){
  html body :is(.loan-card,.form-card,.auth-card,.estimate-card,.calc-panel,.panel,.admin-record,.deal-row){background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none}
}
@media print{
  html body :is(.form-card,.admin-record,.deal-row,.panel){background:white;color:black;box-shadow:none;backdrop-filter:none}
}
