/* iConnect MY provider portal. Brand tokens copied from website/assets/style.css (purple + yellow from the app icon). */
:root {
  --bg: #fbf9ff; --card: #ffffff; --ink: #1b1033; --muted: #55496f; --line: #e4dbf5;
  --brand: #5a12d0; --brand-ink: #ffffff; --accent: #ffbe1c; --accent-ink: #1b0a3d; --soft: #f1eaff;
  --focus: #1b0a3d; --danger: #b3261e; --radius: 14px; --shadow: 0 6px 24px rgba(62, 1, 171, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #130a29; --card: #1d1140; --ink: #f4efff; --muted: #c3b6e2; --line: #34245f;
    --brand: #8a52f5; --soft: #241650; --focus: #ffbe1c; --danger: #ff9b94; --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); overflow-x: hidden;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; }
a { color: var(--brand); text-underline-offset: 3px; }
@media (prefers-color-scheme: dark) { a { color: #cdb4ff; } }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
h1 { font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.2; margin: 0 0 10px; }
h2 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }

.site-header { background: #2f0880; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .12); position: sticky; top: 0; z-index: 20; }
.bar { max-width: 1120px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; margin-right: auto; }
.brand img { border-radius: 9px; display: block; }
.langs { display: flex; border: 1px solid rgba(255, 255, 255, .4); border-radius: 10px; overflow: hidden; }
.langs button { min-width: 40px; height: 40px; padding: 0 6px; border: 0; background: transparent; color: #fff; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.langs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.site-header :focus-visible { outline-color: #ffbe1c; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox[hidden] { display: none; }
.who { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.whoname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.userbox img, .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; }
.avatar { background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; }
@media (max-width: 520px) { .whoname { display: none; } }
.mockbar { background: #ffe9a8; color: #3b2a00; text-align: center; font-weight: 700; font-size: .85rem; padding: 4px 8px; }
.mockbar[hidden] { display: none; }

.shell { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; display: block; }
.shell.with-nav { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 860px) { .shell.with-nav { grid-template-columns: 220px 1fr; } }
.nav[hidden] { display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 860px) { .nav ul { flex-direction: column; flex-wrap: nowrap; } }
.nav a, .nav .disabled { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.nav a { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.nav a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.nav .disabled { color: var(--muted); border: 1px dashed var(--line); cursor: not-allowed; }
.soon { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--soft); color: var(--muted); border-radius: 999px; padding: 2px 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.narrow { max-width: 460px; margin: 24px auto; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type="text"], input[type="email"], input[type="password"] { width: 100%; min-height: 46px; padding: 8px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--muted); border-radius: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 10px 0; min-height: 36px; }
.check input { width: 20px; height: 20px; }
.hint { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }
.error { color: var(--danger); font-weight: 600; min-height: 1.4em; margin: 8px 0; }
.notice { background: #fff4d6; color: #3b2a00; border: 1px solid #e8c766; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
@media (prefers-color-scheme: dark) { .notice { background: #3a3114; color: #ffeaa8; border-color: #8a7430; } }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border-radius: 999px; font: inherit; font-weight: 800; text-decoration: none; border: 2px solid transparent; cursor: pointer; text-align: center; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-brand { background: var(--brand); color: var(--brand-ink); width: 100%; margin-top: 8px; }
.state .btn-brand { width: auto; }
.btn-line { background: transparent; color: var(--brand); border-color: var(--brand); }
@media (prefers-color-scheme: dark) { .btn-line { color: #cdb4ff; border-color: #cdb4ff; } }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.small-btn { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
.state { border-top: 6px solid var(--accent); }
.state-rejected, .state-suspended, .state-error, .state-deleted { border-top-color: var(--danger); }
.reason { background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.chip { display: inline-block; background: var(--soft); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .85rem; }
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.stat .big { font-size: 2rem; font-weight: 800; margin: 4px 0; }
.site-footer { background: #1a0650; color: #e9defc; }
.site-footer a { color: #fff; padding: 10px 4px; display: inline-block; min-height: 40px; }
.site-footer .bar { justify-content: flex-start; gap: 18px; }
.noscript { padding: 16px; text-align: center; }

/* ---- phase 2: requests ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 8px; }
.tab { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.reqlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .reqlist { grid-template-columns: repeat(2, 1fr); } }
.req p { margin: 4px 0; }
.reqhead { display: flex; align-items: center; gap: 10px; }
.reqwho { flex: 1; min-width: 0; }
.reqwho h1, .reqwho h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; object-fit: cover; }
.av-txt { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .85rem; }
.badge { flex: none; font-size: .75rem; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.badge-requested { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge-quoted { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.badge-declined, .badge-cancelled, .badge-expired { background: transparent; color: var(--muted); border-color: var(--muted); }
.due { color: #8a4b00; font-weight: 700; margin: 4px 0; }
@media (prefers-color-scheme: dark) { .due { color: #ffcf6e; } }
.quotebox { background: var(--soft); border: 1px solid var(--brand); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.quotebox p { margin: 2px 0; }
.detail h1 { font-size: 1.4rem; }
.detail h2 { margin-top: 18px; }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.actions .btn { width: auto; margin: 0; }
.btn-danger { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger { color: #1b0a0a; } }
.btn-danger-line { background: transparent; color: var(--danger); border-color: var(--danger); }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; border-left: 3px solid var(--line); }
.timeline li { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 0 4px 12px; }
.tlk { font-weight: 700; min-width: 150px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(92vw, 560px); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 300; box-shadow: var(--shadow); background: #1b1033; color: #fff; }
.toast[hidden] { display: none; }
.toast.warn { background: #fff4d6; color: #3b2a00; border: 1px solid #e8c766; }
.toast.err { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .toast.err { color: #1b0a0a; } .toast.warn { background: #3a3114; color: #ffeaa8; } }
.backdrop { position: fixed; inset: 0; background: rgba(15, 6, 39, .6); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; z-index: 200; }
.dialog { background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 20px; width: 100%; max-width: 520px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.dialog h2 { font-size: 1.25rem; margin: 0 0 6px; }
textarea { width: 100%; padding: 8px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--muted); border-radius: 10px; resize: vertical; }
input[type="date"], input[type="time"] { width: 100%; min-height: 46px; padding: 8px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--muted); border-radius: 10px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 420px) { .row2 { grid-template-columns: 1fr 1fr; } }
fieldset.planned { border: 1px solid var(--line); border-radius: 12px; margin: 14px 0 6px; padding: 8px 12px 12px; }
fieldset.planned legend { font-weight: 800; padding: 0 6px; }
.label-like { font-weight: 600; margin: 12px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipradio { display: inline-flex; margin: 0; }
.chipradio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipradio span { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border: 1px solid var(--muted); border-radius: 999px; font-weight: 700; cursor: pointer; }
.chipradio input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chipradio input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.warnbox { background: #fff4d6; color: #3b2a00; border: 1px solid #e8c766; border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.warnbox[hidden] { display: none; }
.warnbox ul { margin: 6px 0 10px; padding-left: 20px; }
.warnbox .btn { width: auto; margin: 4px 8px 0 0; }
@media (prefers-color-scheme: dark) { .warnbox { background: #3a3114; color: #ffeaa8; border-color: #8a7430; } }
body.modal-open { overflow: hidden; }
.dialog .btn-brand { width: auto; margin: 0; }

/* ---- phase 3: jobs + availability ---- */
.btn-success { background: #1d7a3e; color: #fff; }
@media (prefers-color-scheme: dark) { .btn-success { background: #5fd38a; color: #08210f; } }
.infobox { border-radius: 10px; padding: 10px 14px; margin: 10px 0; border: 1px solid var(--line); background: var(--soft); }
.infobox p { margin: 2px 0; }
.infobox.warn { background: #fff4d6; color: #3b2a00; border-color: #e8c766; }
.infobox.err { background: #fdecea; color: #5c1410; border-color: #e5a29c; }
@media (prefers-color-scheme: dark) { .infobox.warn { background: #3a3114; color: #ffeaa8; border-color: #8a7430; } .infobox.err { background: #3b1613; color: #ffd3cf; border-color: #8a3a34; } }
.notice.offline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.availability { margin-top: 16px; }
.availability h3 { margin: 14px 0 4px; font-size: 1rem; }
.avrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 6px 4px 4px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; border-radius: 999px; }
.switch[disabled] { opacity: .6; cursor: progress; }
.switch .knob { position: relative; width: 46px; height: 26px; flex: none; border-radius: 999px; background: var(--muted); transition: background .15s; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on .knob { background: #1d7a3e; }
.switch.on .knob::after { transform: translateX(20px); }
@media (prefers-color-scheme: dark) { .switch.on .knob { background: #5fd38a; } }
.switch.small { min-height: 40px; font-size: .85rem; }
.site-header .switch.hdr { color: #fff; }
.site-header .switch.hdr .knob { background: rgba(255, 255, 255, .45); }
.site-header .switch.hdr.on .knob { background: #5fd38a; }
@media (max-width: 520px) { .site-header .switch.hdr .swlabel { display: none; } }

/* ---- task 239: Continue with Google / Facebook ---- */
.or { display: flex; align-items: center; gap: 12px; margin: 18px 0 12px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social { display: grid; gap: 10px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; border: 1px solid #747775; }
.social-btn[disabled] { opacity: .6; cursor: progress; }
.social-btn img, .social-btn svg { flex: none; display: block; }
.social-btn.google { background: #fff; color: #1f1f1f; }
.social-btn.facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-btn.facebook .fbmark { background: #fff; border-radius: 50%; }
.linkbtn { background: none; border: 0; padding: 8px 0; min-height: 44px; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
@media (prefers-color-scheme: dark) { .linkbtn { color: #cdb4ff; } }
