/* FG Platform 5.7 — contrast hardening + mobile-first refinement layer */

/* Theme-safe semantic tokens. These intentionally override v2 light-only helper tokens. */
:root{
  --surface-soft:#f8faf9;
  --surface-sunken:#eef3f0;
  --ink-soft:#465850;
  --green-soft:#e9f7f1;
  --amber-soft:#fff6df;
  --danger-soft:#fff0f1;
  --focus-ring:rgba(15,159,110,.18);
  --fixed-light-bg:#ffffff;
  --fixed-light-ink:#10211b;
  --fixed-light-muted:#5e6f67;
  --fixed-light-soft:#7e8e87;
  --fixed-light-line:rgba(16,33,27,.13);
  --highlight-bg:linear-gradient(145deg,#edf8f3,#fbfdfc);
  --highlight-ink:#10211b;
  --highlight-muted:#596b63;
  --highlight-line:#b9decf;
  --warning-text:#805500;
  --danger-text:#b63f4b;
  --success-text:#0d6849;
}
html[data-theme=dark]{
  color-scheme:dark;
  --surface-soft:#0c1713;
  --surface-sunken:#0a1410;
  --ink-soft:#cad7d1;
  --green-soft:#123226;
  --amber-soft:#302610;
  --danger-soft:#32191d;
  --focus-ring:rgba(54,211,153,.2);
  --highlight-bg:linear-gradient(145deg,#123528,#10251e);
  --highlight-ink:#f4fbf7;
  --highlight-muted:#b6c9c0;
  --highlight-line:#24513f;
  --warning-text:#ffd478;
  --danger-text:#ff9ca5;
  --success-text:#59e5b1;
}
html[data-theme=light]{color-scheme:light}

/* Form/readability guardrails */
::placeholder{color:var(--soft);opacity:1}
input:disabled,select:disabled,textarea:disabled,button:disabled{opacity:.62;cursor:not-allowed}
input,select,textarea{caret-color:var(--brand)}
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px}

/* Fixed-light surfaces must own their own text palette in every theme. */
.product-gateway-card:not(.tagesgeld-gateway){
  background:var(--fixed-light-bg)!important;
  color:var(--fixed-light-ink)!important;
  border-color:var(--fixed-light-line)!important;
}
.product-gateway-card:not(.tagesgeld-gateway) h1,
.product-gateway-card:not(.tagesgeld-gateway) h2,
.product-gateway-card:not(.tagesgeld-gateway) h3,
.product-gateway-card:not(.tagesgeld-gateway) b,
.product-gateway-card:not(.tagesgeld-gateway) strong,
.product-gateway-card:not(.tagesgeld-gateway) i{color:var(--fixed-light-ink)!important}
.product-gateway-card:not(.tagesgeld-gateway) p,
.product-gateway-card:not(.tagesgeld-gateway) small,
.product-gateway-card:not(.tagesgeld-gateway) .gateway-meta span{color:var(--fixed-light-muted)!important}
.product-gateway-card:not(.tagesgeld-gateway) .gateway-meta{border-top-color:var(--fixed-light-line)!important}
.product-gateway-card:not(.tagesgeld-gateway) .product-chip{background:#e8f7f1!important;color:#087452!important}
.tagesgeld-gateway h2,.tagesgeld-gateway h3,.tagesgeld-gateway b,.tagesgeld-gateway strong,.tagesgeld-gateway i{color:#f6fffb!important}
.tagesgeld-gateway p{color:#c2d2cb!important}.tagesgeld-gateway .gateway-meta span{color:#abc1b8!important}

/* Dashboard highlight card: light mode uses dark text, dark mode uses bright text. */
.green-card{
  background:var(--highlight-bg)!important;
  border-color:var(--highlight-line)!important;
  color:var(--highlight-ink)!important;
}
.green-card small,.green-card p,.green-card span:not(.pill){color:var(--highlight-muted)!important}
.green-card strong,.green-card b,.green-card h1,.green-card h2,.green-card h3,.green-card .corner-icon{color:var(--highlight-ink)!important}

/* Dark feature cards always use an explicit light palette. */
.gradient-card.purple-blue,.live-result-card,.management-hero,.home-ready-card,.auth-side{
  color:#f6fffb!important;
}
.gradient-card.purple-blue small,.gradient-card.purple-blue p,.gradient-card.purple-blue .corner-icon,
.live-result-card small,.live-result-card p,.management-hero p,.management-hero small,.management-hero span,.home-ready-card p,.auth-side p{color:#bed0c7!important}
.gradient-card.purple-blue strong,.gradient-card.purple-blue b,.gradient-card.purple-blue h1,.gradient-card.purple-blue h2,
.live-result-card strong,.live-result-card b,.management-hero strong,.management-hero b,.management-hero h1,.home-ready-card h2,.auth-side h1,.auth-side h2{color:#fff!important}

/* Theme helper components that previously used light-only colors. */
.filter-live{background:var(--green-soft)!important;color:var(--success-text)!important}
.rate-pill{background:var(--amber-soft)!important;color:var(--warning-text)!important}
.protection-note{background:var(--green-soft)!important;color:var(--success-text)!important}
.protection-note span{color:var(--muted)!important}
.scenario-card.active{background:var(--green-soft)!important;color:var(--ink)!important}
.request-rejection-note,.request-history-row .request-reason{background:var(--danger-soft)!important;color:var(--danger-text)!important}
.pill.green{color:var(--success-text)!important}
.term-pills button.active,.country-pills button.active,.management-rule i{color:var(--success-text)!important}
.pill.amber{color:var(--warning-text)!important}
.pill.red{color:var(--danger-text)!important}
html[data-theme=dark] .btn-danger-soft{color:#ff9ca5!important;background:rgba(209,79,92,.12)!important}
html[data-theme=dark] .green-text{color:#59e5b1!important}

/* Cards that follow the active theme must explicitly inherit the active text palette. */
.content-card,.panel,.auth-card,.verification-card,.profile-side,.profile-strip,.support-ticket-card,.support-new-card,
.ticket-reply-card,.notice-card,.empty-card,.bank-card,.scenario-card,.selected-offer-card,.key-terms-card,
.top-rate-card,.deposit-table,.deposit-row,.request-history-row,.dashboard-explainer article,.metric-grid article:not(.gradient-card):not(.green-card){
  color:var(--ink);
}
.content-card p,.panel p,.auth-card p,.verification-card p,.profile-side p,.profile-strip span,.support-ticket-card p,
.support-new-card p,.ticket-reply-card p,.notice-card p,.empty-card p,.bank-card p,.scenario-card p,.selected-offer-card p,
.key-terms-card p,.top-rate-card p,.deposit-row small,.request-history-row small,.dashboard-explainer p,
.metric-grid article:not(.gradient-card):not(.green-card) p,.metric-grid article:not(.gradient-card):not(.green-card) small{color:var(--muted)}
.metric-grid article:not(.gradient-card):not(.green-card) strong,.metric-grid article:not(.gradient-card):not(.green-card) b,
.dashboard-explainer b,.deposit-row b,.request-history-row b,.top-rate-card strong,.content-card h2,.content-card h3{color:var(--ink)}

/* Backoffice was visually converted to a light shell in v5.6; complete that conversion so text can never inherit white from the legacy dark shell. */
.admin-body{background:#f1f5f3!important;color:#10211b!important}
.admin-main{background:#f1f5f3!important;color:#10211b!important}
.admin-topbar{color:#10211b!important}
.admin-topbar .micro{color:#687a72!important}
.admin-content,.admin-page-head,.admin-card,.admin-stat-grid a{color:#10211b}
.admin-card{background:#fff!important;border-color:#dce6e0!important}
.admin-card p,.admin-page-head p,.admin-card small{color:#66766f}
.admin-table th{color:#6d7d76!important;background:#f4f8f6!important}
.admin-table td{color:#10211b!important;border-color:#e2eae6!important}
.admin-table td small{color:#788880!important}.admin-table code{color:#40554c!important}
.admin-card .field input,.admin-card .field select,.admin-card .field textarea,.decision-forms input{background:#f7faf8!important;color:#10211b!important;border-color:#dce6e0!important}
.admin-help-card p{color:#66766f!important}.quick-admin-links a{background:#f7faf8!important;border-color:#dce6e0!important;color:#40554c!important}
.content-editor-row header code{background:#edf3ef!important;color:#40554c!important}

/* Desktop polish: avoid text clipping and keep semantic cards stable. */
.product-gateway-card,.metric-grid article,.compare-card,.content-card,.deposit-row,.request-history-row{overflow-wrap:anywhere}
.dashboard-metrics article{isolation:isolate}
.dashboard-metrics article .corner-icon{z-index:1}
.section-title-row{gap:18px}

/* =========================================================
   Mobile client — dedicated composition, same visual identity
   ========================================================= */
@media(max-width:980px){
  .site-header{backdrop-filter:blur(20px) saturate(1.2)}
  .mobile-nav.open{gap:6px;border-top:1px solid var(--line);box-shadow:0 24px 55px rgba(0,0,0,.16)}
  .mobile-nav a,.mobile-nav-form{min-height:46px;display:flex;align-items:center;padding:11px 12px!important;border:1px solid transparent!important;border-radius:12px;color:var(--ink);font-weight:750}
  .mobile-nav a:hover,.mobile-nav a:focus-visible,.mobile-nav-form:hover{background:var(--surface-2);border-color:var(--line)!important}
  .product-gateway-card{min-width:0}
  .dashboard-heading h1{max-width:100%}
  .compare-card{min-width:0}
}

@media(max-width:720px){
  :root{--radius:18px;--radius-sm:12px;--radius-lg:22px}
  body{font-size:14px;overflow-x:hidden}
  .container{width:calc(100% - 24px)!important}
  .site-header{position:sticky;top:0}
  .header-inner{height:66px!important;gap:8px!important}
  .header-actions{gap:5px!important;min-width:0}
  .site-header .brand{min-width:0;font-size:17px!important;gap:8px}
  .site-header .site-logo{max-width:126px;object-fit:contain}
  .pill-switch{padding:1px}.pill-switch a{padding:6px 7px}
  .icon-button,.mobile-menu-button{width:38px!important;height:38px!important;border-radius:12px!important;flex:none}
  .mobile-nav.open{max-height:calc(100dvh - 66px)!important;padding:10px 12px 16px!important}

  .landing-hero,.landing-hero-grid{min-height:auto!important}
  .landing-hero{padding-bottom:66px}
  .landing-hero:after{background:linear-gradient(180deg,rgba(7,22,17,.97) 0%,rgba(7,22,17,.89) 68%,rgba(7,22,17,.76) 100%)!important}
  .landing-copy{padding:44px 0 44px!important}
  .landing-copy h1{font-size:clamp(2.35rem,11.5vw,3.65rem)!important;line-height:1.01!important;margin:16px 0 18px!important}
  .landing-copy>p{font-size:15px!important;line-height:1.62!important}
  .hero-actions{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;margin-top:24px!important}
  .hero-actions .btn{width:100%;min-height:50px!important}
  .hero-text-link{width:100%;text-align:center;padding:10px!important}
  .landing-trust{margin-top:22px!important;gap:8px!important}
  .product-gateway-section{margin-top:-34px!important;padding-bottom:18px!important}
  .product-gateway-grid{grid-template-columns:1fr!important;gap:12px!important}
  .product-gateway-card{min-height:0!important;padding:22px!important;border-radius:22px!important;box-shadow:0 18px 48px rgba(12,30,23,.12)!important}
  .product-gateway-card h2{font-size:clamp(1.75rem,8vw,2.25rem)!important;line-height:1.04;margin:13px 0 10px!important}
  .gateway-meta{margin-top:24px!important;padding-top:15px!important;display:grid!important;grid-template-columns:1fr auto!important;align-items:end!important}
  .gateway-meta b{margin-left:0!important;grid-column:1;font-size:14px!important}
  .gateway-meta i{grid-column:2;grid-row:1/3;align-self:center;font-size:24px!important}

  .section{padding-block:42px!important}.section-heading{margin-bottom:20px!important}.section-heading h2{font-size:clamp(1.75rem,8vw,2.3rem)!important}
  .home-calc-grid{gap:22px!important}.live-result-card{padding:24px!important;border-radius:22px!important}.live-rate span{font-size:46px!important}
  .home-ready-card{border-radius:22px!important}

  .page-hero.compact{padding:40px 0 28px!important}.page-hero h1{font-size:clamp(2rem,9.5vw,3rem)!important;line-height:1.03}.page-hero p{font-size:14px!important;line-height:1.6!important}
  .product-type-switch{width:100%;display:grid!important;grid-template-columns:1fr 1fr!important}.product-type-switch .btn{min-width:0!important;padding-inline:8px!important}
  .filter-panel{padding:16px!important;border-radius:18px!important;box-shadow:var(--shadow-sm)!important}
  .compare-card{grid-template-columns:1fr 1fr!important;gap:10px!important;padding:16px!important;border-radius:18px!important}
  .compare-bank{grid-column:1/-1!important}.compare-term,.compare-rate,.compare-yield{padding:11px!important;border:1px solid var(--line);border-radius:13px!important;background:var(--surface-2)!important}
  .compare-yield{grid-column:1/-1!important}.compare-actions{grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}.compare-actions .btn{width:100%}

  .dashboard-page{padding:28px 0 50px!important}.dashboard-heading{margin-bottom:20px!important;gap:16px!important}.dashboard-heading h1{font-size:clamp(2rem,9vw,2.75rem)!important;line-height:1.02!important}.dashboard-heading p{margin-bottom:4px}.dashboard-heading>.btn{width:100%;min-height:48px}
  .metric-grid.four{grid-template-columns:1fr 1fr!important;gap:10px!important}.metric-grid article{min-height:128px!important;padding:18px!important;border-radius:18px!important}.metric-grid article strong{font-size:clamp(1.65rem,7vw,2rem)!important}.dashboard-metrics{margin-bottom:24px!important}
  .dashboard-explainer{gap:9px!important;margin-bottom:24px!important}.dashboard-explainer article{padding:13px!important;border-radius:15px!important}.dashboard-explainer article>span{width:32px!important;height:32px!important}
  .dashboard-section{margin-top:26px!important}.section-title-row{align-items:flex-start!important;flex-direction:column!important;gap:6px!important}.section-title-row h2{font-size:22px!important;margin-bottom:4px}

  .deposit-table{border:0!important;background:transparent!important;box-shadow:none!important;display:grid!important;gap:10px!important;overflow:visible!important}
  .deposit-row{grid-template-columns:1fr 1fr!important;gap:13px!important;padding:17px!important;border:1px solid var(--line)!important;border-radius:18px!important;background:var(--surface)!important;box-shadow:var(--shadow-sm)!important}
  .deposit-row:hover{background:var(--surface)!important}.deposit-name{grid-column:1/-1!important;padding-bottom:10px;border-bottom:1px solid var(--line)}
  .deposit-cell,.progress-cell{min-width:0}.progress-cell{grid-column:1/-1!important;padding-top:2px}.mobile-cell-label{display:block!important;margin-bottom:3px!important}
  .request-history-list{gap:9px!important}.request-history-row{padding:15px!important;border-radius:16px!important}.request-history-main{gap:10px!important}
  .dashboard-quick-links{gap:9px!important}.profile-strip{margin-top:0!important;padding:16px!important;border-radius:16px!important}

  .premium-detail-heading{padding:20px!important;border-radius:20px!important}.management-hero{padding:22px!important;border-radius:20px!important}.management-balance{text-align:left!important}.management-grid{gap:12px!important}.tagesgeld-action-form,.management-info-card{padding:20px!important}.action-choice-grid{grid-template-columns:1fr!important;gap:8px!important}.action-choice>span{padding:16px!important;border-radius:15px!important}.payout-summary{grid-template-columns:1fr!important}

  .content-card,.standalone-page-card,.contact-page-card{padding:20px!important;border-radius:18px!important}.auth-page{padding:26px 12px 46px!important}.auth-grid{border-radius:20px!important}.auth-card{padding:24px 20px!important}.verification-card{padding:24px 20px!important}.profile-grid,.support-ticket-main{gap:12px!important}
  .support-ticket-card,.support-new-card,.ticket-reply-card{border-radius:17px!important}.message-bubble{max-width:calc(100% - 34px)!important}

  .site-footer{margin-top:26px!important;padding:38px 0 22px!important}.site-footer .footer-grid{grid-template-columns:1fr 1fr!important;gap:26px 18px!important}.site-footer .footer-grid>div:first-child{grid-column:1/-1!important}
}

@media(max-width:520px){
  .container{width:calc(100% - 20px)!important}
  .header-inner{height:62px!important}.mobile-nav.open{max-height:calc(100dvh - 62px)!important}
  .site-header .brand{font-size:16px!important}.site-header .brand-mark{width:34px!important;height:34px!important}
  .lang-switch span{display:none!important}.pill-switch a{padding:6px!important}
  .landing-copy{padding-top:38px!important}.landing-copy h1{font-size:clamp(2.2rem,11.8vw,3rem)!important}
  .update-badge{font-size:9.5px!important;max-width:100%;white-space:normal}
  .product-gateway-card{padding:19px!important;border-radius:19px!important}.product-chip{font-size:9px!important}.gateway-meta{grid-template-columns:1fr 28px!important}
  .metric-grid.four,.metric-grid.two{grid-template-columns:1fr!important}.metric-grid article{min-height:112px!important}.dashboard-heading h1{font-size:clamp(1.9rem,10vw,2.45rem)!important}
  .dashboard-explainer article{gap:10px!important}.dashboard-explainer p{font-size:11px!important}
  .deposit-row{grid-template-columns:1fr!important}.deposit-name,.deposit-cell,.progress-cell{grid-column:1!important}.deposit-cell{display:grid!important;grid-template-columns:1fr auto!important;align-items:end;gap:4px 12px}.deposit-cell .mobile-cell-label{grid-column:1}.deposit-cell b{grid-column:2;grid-row:1}.deposit-cell small:not(.mobile-cell-label){grid-column:1/-1}.progress-cell{justify-content:flex-start!important}
  .request-history-main{align-items:flex-start!important;flex-direction:column!important}.request-history-main .pill{align-self:flex-start!important}
  .compare-card{grid-template-columns:1fr!important}.compare-bank,.compare-term,.compare-rate,.compare-yield,.compare-actions{grid-column:1!important}.compare-actions{grid-template-columns:1fr!important}.compare-tools,.sort-control{width:100%!important;align-items:stretch!important;flex-direction:column!important}.sort-control select{width:100%!important}
  .amount-control{grid-template-columns:40px 1fr 40px!important}.amount-control output{font-size:18px!important}
  .home-ready-actions,.inactivity-actions{grid-template-columns:1fr!important}
  .profile-strip{align-items:flex-start!important;flex-direction:column!important;gap:8px!important}.profile-strip b{align-self:flex-start}
  .contact-detail-grid{grid-template-columns:1fr!important}
  .site-footer .footer-grid{grid-template-columns:1fr!important}.site-footer .footer-grid>div:first-child{grid-column:1!important}
  .admin-content{padding:16px 10px 38px!important}.admin-stat-grid{grid-template-columns:1fr!important}.admin-card{padding:17px!important;border-radius:16px!important}.admin-page-head h1{font-size:30px!important}.admin-table{min-width:760px!important}
}

@media(max-width:390px){
  .site-header .brand>span:last-child{display:none}
  .header-actions{margin-left:auto}
  .landing-copy h1{font-size:2.2rem!important}
  .dashboard-heading h1{font-size:1.9rem!important}
  .btn{padding-inline:13px}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}

/* Backoffice tablet/mobile shell must not retain the desktop grid column off-screen. */
@media(max-width:980px){
  .admin-shell{grid-template-columns:1fr!important}
  .admin-sidebar{position:fixed!important;left:0!important;top:0!important;height:100dvh!important;width:min(286px,86vw)!important;transform:translateX(-105%)!important;z-index:140!important;box-shadow:18px 0 50px rgba(0,0,0,.22)}
  .admin-sidebar.open{transform:none!important}
  .admin-main{margin-left:0!important;width:100%!important}
  .admin-topbar{justify-content:space-between!important}
}
@media(max-width:520px){
  .lang-switch{display:flex!important}
}
