/* MFOCAN | cross-screen responsive polish | 2026-10-08
   Isolated to the 2026 app shell. Original PHP/API/DB untouched. */
:root {
  --mf-app-bg:#0b0b0e; --mf-panel:#17171c; --mf-panel-hover:#222229;
  --mf-stroke:#303039; --mf-text:#f7f7fa; --mf-subtle:#a9a9b5;
  --mf-coral:#fa756a; --mf-inset:clamp(16px,4vw,54px);
}
html {overflow-x:clip}
body {min-width:280px}
body.mf-app-view {background:var(--mf-app-bg);color:var(--mf-text);color-scheme:dark}
body.mf-auth-view {background:#050505;color-scheme:dark}
#bodycontent,.mf-shell,.mf-content {min-width:0;max-width:100%}
#bodycontent {overflow-x:clip}
.mf-app-header {box-sizing:border-box;flex-wrap:nowrap;isolation:isolate}
.mf-brand-button,.mf-header-actions,#auth-status,.mf-icon-btn,.mf-header-login,.mf-account-menu {width:auto;flex-shrink:0}
.mf-brand-button{min-width:0;max-width:calc(100vw - 158px);flex:0 1 auto}
.mf-brand-word{min-width:0;overflow:hidden;text-overflow:ellipsis}
.mf-header-actions{margin-left:auto;min-width:0}
.mf-icon-btn{padding:0;flex:none}
.mf-header-login{display:inline-flex;align-items:center;justify-content:center;min-width:75px;max-width:110px;white-space:nowrap; padding-inline:14px}
.mf-account-menu>summary{width:auto}
.mf-app-view .mf-content {background:var(--mf-app-bg);min-height:calc(100dvh - 140px)}
.mf-app-view .mf-content > section:not(.mf-home) {
  width:100%;min-height:calc(100dvh - 150px);background:var(--mf-app-bg)!important;
  color:var(--mf-text);padding:clamp(22px,3vw,44px) var(--mf-inset) 48px!important;
  box-sizing:border-box;overflow-x:clip;
}
.mf-app-view .mf-content .business-menu{width:100%;max-width:980px;min-width:0;margin-inline:auto!important;padding:15px 0!important}
/* Consistent titles, subtitles, back actions across ALL category screens. */
.mf-content header[id$="-page-header"]{
  box-sizing:border-box;width:100%;max-width:960px!important;min-width:0;
  margin:0 auto 22px!important;gap:14px!important;position:relative;
}
.mf-content header[id$="-page-header"] h1,
.mf-content header[id$="-page-header"] h2{color:var(--mf-text)!important;font-family:Manrope,'DM Sans',sans-serif!important;font-size:clamp(1.5rem,4.5vw,2.35rem)!important;line-height:1.13!important;font-weight:800!important;letter-spacing:-.045em!important;text-align:left!important;margin:0!important;max-width:100%}
.mf-content header[id$="-page-header"] p,
.mf-content header[id$="-page-header"] span[style*="text-transform: uppercase"]{color:var(--mf-coral)!important;text-align:left!important;letter-spacing:.13em!important}
.mf-content header[id$="-page-header"] div[style*="text-align: center"]{text-align:left!important}
.mf-content header[id$="-page-header"] .menu-button,
.mf-content header[id$="-page-header"] .back-btn,
.mf-content header[id$="-page-header"] button[id$="-back-btn"]{
  display:inline-flex!important;align-items:center;justify-content:center;align-self:flex-start;
  width:auto!important;min-width:85px;max-width:max-content;min-height:43px!important;
  padding:10px 16px!important;background:var(--mf-panel)!important;
  border:1px solid var(--mf-stroke)!important;border-radius:12px!important;
  color:var(--mf-text)!important;font-size:.82rem!important;font-weight:700!important;
  white-space:nowrap;box-shadow:none!important;
}
.mf-content .menu-button:not(:disabled):focus-visible,
.mf-content .back-btn:focus-visible{outline-offset:2px}
/* Supply, discover, category and services top-level option cards. */
.mf-content #business-supply-names-container,
.mf-content #business-ad-names-container,
.mf-content #business-supply-buttons-container,
.mf-content #dynamic-category-buttons-container,
.mf-content #ad-category-buttons-container,
.mf-content #requests-list-container {width:100%!important;min-width:0;max-width:100%;gap:11px!important}
.mf-content #business-supply-names-container > button,
.mf-content #business-ad-names-container > button,
.mf-content #business-supply-buttons-container > button,
.mf-content #dynamic-category-buttons-container > button,
.mf-content #ad-category-buttons-container > button{
  background:var(--mf-panel)!important;color:var(--mf-text)!important;
  border:1px solid var(--mf-stroke)!important;border-radius:15px!important;
  min-height:64px!important;width:100%!important;max-width:100%!important;
  font-size:clamp(.91rem,2.8vw,1.06rem)!important;line-height:1.35!important;
  padding:16px 18px!important;text-align:left!important;box-shadow:none!important;
  overflow-wrap:anywhere;transition:background .16s,border-color .16s,transform .16s!important;
}
.mf-content #business-supply-names-container > button:hover,
.mf-content #business-ad-names-container > button:hover,
.mf-content #business-supply-buttons-container > button:hover,
.mf-content #dynamic-category-buttons-container > button:hover,
.mf-content #ad-category-buttons-container > button:hover{
  background:var(--mf-panel-hover)!important;border-color:var(--mf-coral)!important;
}
/* Gentle readable empty/loading states, even when legacy inline text was dark. */
.mf-content #business-supply-names-container > p,
.mf-content #business-ad-names-container > p,
.mf-content #business-supply-buttons-container > p,
.mf-content #requests-list-container > p,
.mf-content #ad-category-buttons-container > p,
.mf-content #dynamic-category-buttons-container > p{color:var(--mf-subtle)!important;line-height:1.6!important}
.mf-content .mf-quiet-footer,.mf-quiet-footer{background:var(--mf-app-bg);color:#6e6e79!important;font-size:10px;opacity:.72}
.mf-content footer:not(.mf-quiet-footer){color:#6e6e79!important;font-size:10px!important;opacity:.56}
.mf-content footer:not(.mf-quiet-footer) p{color:#777782!important;font-size:10px!important;text-transform:none!important}
.mf-content > section .menu-content{max-width:1050px}
/* Tender/request form: precise dark card, high contrast titles, keyboard-friendly fields. */
.mf-app-view .mf-content .page-container{display:flex;flex-direction:column;align-items:center;gap:0;background:var(--mf-app-bg)!important;padding:22px 16px 48px!important}
.mf-content .request-header{max-width:760px;width:100%;margin:0 auto 24px;padding:0;display:flex;flex-direction:column;align-items:flex-start;gap:17px}
.mf-content .request-header .header-titles{width:100%;flex-grow:0;text-align:left!important}
.mf-content .request-header .header-titles h1{color:var(--mf-text)!important;font-size:clamp(1.8rem,6.7vw,2.5rem)!important;font-weight:800;line-height:1.14;letter-spacing:-.045em}
.mf-content .request-header .header-titles p{margin:6px 0 0!important;color:var(--mf-coral)!important;font-size:.8rem!important;letter-spacing:.15em}
.mf-content .request-header .back-btn{background:var(--mf-panel)!important;color:#fff!important;border:1px solid var(--mf-stroke)!important;border-radius:12px;min-height:43px;width:auto!important;gap:8px;padding:9px 15px!important}
.mf-content .form-section{width:100%;max-width:760px;display:flex;justify-content:center;align-items:stretch;padding:0;margin:0 auto}
.mf-content .modern-form{display:flex;flex-direction:column;gap:4px;width:100%;max-width:100%;background:var(--mf-panel)!important;color:var(--mf-text)!important;border:1px solid var(--mf-stroke)!important;border-radius:22px!important;box-shadow:0 15px 45px rgba(0,0,0,.14)!important;padding:clamp(20px,5vw,35px)!important}
.mf-content .modern-form .input-group{margin-bottom:17px;width:100%;min-width:0}
.mf-content .modern-form label{color:#e8e8ec!important;font-size:.78rem!important;font-weight:750!important;letter-spacing:.05em!important;text-transform:uppercase}
.mf-content .modern-form input,
.mf-content .modern-form select,
.mf-content .modern-form textarea,
.mf-content .business-menu input:not([type="checkbox"]):not([type="radio"]),
.mf-content .business-menu select,
.mf-content .business-menu textarea{
  box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:50px;
  border:1px solid #3b3b45!important;border-radius:12px!important;
  background:#101014!important;color:#f6f6f8!important;
  font-family:'DM Sans',system-ui,sans-serif!important;font-size:16px!important;
  padding:12px 14px!important;outline:none;
  -webkit-appearance:auto;appearance:auto;
}
.mf-content .modern-form textarea{min-height:108px;resize:vertical}
.mf-content .modern-form input::placeholder,
.mf-content .modern-form textarea::placeholder,
.mf-content .business-menu input::placeholder {color:#858594!important;opacity:1}
.mf-content .modern-form select:focus,
.mf-content .modern-form input:focus,
.mf-content .modern-form textarea:focus,
.mf-content .business-menu :is(select,input,textarea):focus{border-color:var(--mf-coral)!important;box-shadow:0 0 0 3px rgba(250,117,106,.16)!important}
.mf-content .modern-form select option,
.mf-content .business-menu select option{background:#16161b;color:#fff}
.mf-content .modern-form .submit-btn{
  width:100%;min-height:53px;margin-top:5px;padding:13px 18px!important;
  background:#eb554d!important;border:none!important;border-radius:12px!important;
  color:white!important;font-size:.95rem!important;font-weight:800!important;
  box-shadow:none!important;
}
.mf-content .modern-form .submit-btn:hover{background:#d9423b!important}
.mf-content .modern-form .status-message{color:#ffbbb6;line-height:1.4}
/* The input form is never covered by decorative/legacy layers. */
.mf-auth-aside,.mf-auth-card,.mf-auth-form,.mf-auth-tabs {position:relative;z-index:1}
.mf-auth-form input{width:100%!important;max-width:100%;pointer-events:auto!important;user-select:text;-webkit-user-select:text}
.mf-auth-layout .mf-input-wrap{z-index:1;isolation:isolate}
.mf-auth-layout .mf-input-wrap input{position:relative;z-index:2;color:#fff!important;caret-color:#fff!important}
.mf-auth-view .mf-show-password{width:48px!important;flex:0 0 48px!important}
.mf-auth-view .mf-auth-tabs button{width:auto;min-width:0}
.mf-auth-view .mf-guest-btn{width:100%}
/* Clean, keyboard-accessible modal, with a path back to Sign in. */
.mf-modal-backdrop{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:20px;background:rgba(0,0,0,.78);backdrop-filter:blur(5px)}
.mf-modal{width:min(100%,420px);max-height:min(80dvh,580px);overflow-y:auto;background:#1b1b20;border:1px solid #44444c;border-radius:20px;padding:24px;color:#fafafa;box-shadow:0 24px 64px #0009}
.mf-modal h3{font-family:Manrope,sans-serif;letter-spacing:-.03em;font-size:1.25rem;line-height:1.2;margin:0 0 12px}
.mf-modal p{font-size:.95rem;color:#c2c2cb;line-height:1.6;margin:0}
.mf-modal-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:24px}
.mf-modal-actions button{width:auto;min-height:46px;padding:10px 17px;font-size:.9rem;font-weight:700;border-radius:12px}
.mf-modal-signin{background:#fff;color:#111;border:1px solid #fff}
.mf-modal-close{background:#29292f;color:#f2f2f4;border:1px solid #41414c}
/* Navigation stays legible on 320px phones and above. */
.mf-bottom-nav{width:100%;min-width:0;box-sizing:border-box}
.mf-bottom-nav .mf-nav-link{width:auto;flex:1 1 0;min-width:0;line-height:1.15;transition:color .12s,background .12s}
.mf-bottom-nav .mf-nav-link i{width:auto}
.mf-bottom-nav .mf-nav-link.is-active{color:#fff;background:#29292e}
.mf-bottom-nav .mf-nav-link.is-active i{color:var(--mf-coral)}
.mf-quiet-footer{user-select:none}
@media (max-width:700px){
 .mf-app-header{min-height:65px!important;padding:calc(8px + env(safe-area-inset-top,0px)) 13px 8px!important;gap:8px!important}
 .mf-brand-button{gap:8px!important;padding:2px!important;max-width:calc(100vw - 155px)!important}
 .mf-header-mark{width:39px;height:39px;flex:none}
 .mf-brand-word{font-size:.9rem!important;letter-spacing:.08em!important}
 .mf-brand-word small{font-size:.46rem!important;letter-spacing:.05em!important}
 .mf-header-actions{gap:7px!important}
 .mf-icon-btn{width:42px!important;height:42px!important}
 .mf-header-login{font-size:.77rem!important;min-width:72px!important;width:auto!important;min-height:42px!important}
 .mf-app-view .mf-content > section:not(.mf-home){padding:22px 16px 38px!important}
 .mf-app-view .mf-content .page-container{padding:24px 16px 32px!important}
 .mf-content .request-header{margin-bottom:20px!important}
 .mf-content .modern-form{border-radius:18px!important}
 .mf-app-view .mf-quiet-footer{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))!important}
 .mf-bottom-nav{padding:5px 4px max(6px,env(safe-area-inset-bottom,0px))!important}
 .mf-nav-link{min-height:57px!important;gap:5px!important;padding:5px 0!important;font-size:.64rem!important}
 .mf-auth-aside{padding:calc(24px + env(safe-area-inset-top,0px)) 22px calc(24px + env(safe-area-inset-bottom,0px))!important;min-height:100dvh}
 .mf-auth-tabs{width:100%!important}
 .mf-auth-view .mf-auth-card{width:100%;min-width:0}
 .mf-auth-card-head h2{font-size:2rem}
 .mf-feature-card{min-width:0}
}
@media(max-width:370px){
 .mf-brand-word small{display:none}
 .mf-brand-word{font-size:.76rem!important}
 .mf-brand-button{max-width:calc(100vw - 151px)!important}
 .mf-feature-grid{gap:10px!important}
 .mf-feature-card{padding:13px 10px!important}
 .mf-card-bottom strong{font-size:.92rem!important}
 .mf-card-bottom small{font-size:.67rem!important}
 .mf-content .modern-form{padding:18px!important}
 .mf-nav-link{font-size:.59rem!important}
}
@media(prefers-reduced-motion:reduce){.mf-app-view *{scroll-behavior:auto!important}}

/* Clear access state for signed-out users instead of a half-loaded request form. */
.mf-gated-card{display:flex;flex-direction:column;align-items:flex-start;gap:15px;width:100%;max-width:500px;margin:0 auto;background:var(--mf-panel);border:1px solid var(--mf-stroke);border-radius:22px;padding:clamp(24px,6vw,40px)}
.mf-gated-card>i{display:grid;place-items:center;width:50px;height:50px;border-radius:14px;background:#28282f;color:var(--mf-coral);font-size:24px}
.mf-gated-card h2{color:#fff;font-size:clamp(1.55rem,5vw,2.1rem);letter-spacing:-.04em;font-family:Manrope,sans-serif;line-height:1.15;margin:0}
.mf-gated-card p{color:var(--mf-subtle);font-size:.92rem;line-height:1.65;margin:0 0 6px}
.mf-gated-card .mf-auth-primary{margin-top:5px}
.mf-gated-card .mf-guest-btn{background:transparent}
