/* WebWrite Jobs: dark navy, soft indigo glow, cyan-to-indigo accents. */
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-latin.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --bg: #0a0b17;
  --panel: #151829;
  --panel-2: #12152a;
  --field: #0e1120;
  --line: rgba(255, 255, 255, 0.08);
  --edge: rgba(129, 140, 248, 0.2);
  --text: #f4f5fb;
  --soft: #c9cde0;
  --muted: #8a90a8;
  --accent: #6366f1; /* indigo */
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --ok: #34d399;
  --warn: #f59e0b;
  --err: #f43f5e;
  --blue: #7dd3fc;
  --grad: linear-gradient(90deg, #22d3ee 0%, #6366f1 100%);
  --grad-indigo: linear-gradient(90deg, #4f46e5 0%, #6d5efc 100%);
  --glow: 0 0 40px rgba(99, 102, 241, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute always wins over display rules */
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); min-height: 100vh;
  font: 15px/1.55 "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 520px at 50% -140px, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(700px 400px at 100% 0%, rgba(34, 211, 238, 0.07), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: rgba(255, 255, 255, 0.07); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }
::selection { background: rgba(99, 102, 241, 0.45); }

/* ---- Header: logo, floating pill navigation, account --------------------------------- */
header {
  display: flex; align-items: center; gap: 20px; padding: 14px 28px;
  position: sticky; top: 0; z-index: 3;
  background: rgba(10, 11, 23, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; font-weight: 800; font-size: 21px; letter-spacing: -0.01em; white-space: nowrap; }
/* Logo: a gradient tile with a "W" cut out of it */
.brand::before {
  content: ""; width: 28px; height: 28px; margin-right: 10px; border-radius: 9px; flex: none;
  background: var(--grad); box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
  --logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cmask id='m'%3E%3Crect width='28' height='28' rx='8' fill='white'/%3E%3Cpath d='M6.2 9.2l3.6 10.1 4.2-7.6 4.2 7.6 3.6-10.1' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Crect width='28' height='28' rx='8' mask='url(%23m)'/%3E%3C/svg%3E");
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
}
.brand span { margin-left: 0.28em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav {
  display: flex; gap: 4px; margin: 0 auto; padding: 6px;
  background: rgba(21, 24, 41, 0.85); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.12);
}
nav button {
  background: none; border: 0; color: var(--soft); padding: 8px 18px; border-radius: 999px;
  cursor: pointer; font: inherit; font-size: 15px; font-weight: 600;
}
nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); filter: none; }
nav button.active { color: #fff; background: var(--grad-indigo); box-shadow: 0 0 22px rgba(99, 102, 241, 0.45); }
.budget { font-size: 12.5px; color: var(--muted); min-width: 150px; text-align: right; }
.budget:empty { display: none; }
.budget .bar { height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; margin-top: 5px; overflow: hidden; }
.budget .bar div { height: 100%; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.user button.small { margin-left: 0; }

main { padding: 26px 28px 20px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }

/* ---- Cards ------------------------------------------------------------------------------ */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), var(--glow);
}
.card-head { font-weight: 700; font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.005em; }
.muted { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.card-head .muted { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split > .card { margin-bottom: 20px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---- Form controls ---------------------------------------------------------------------- */
input, select, textarea {
  background: var(--field); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font: inherit; font-size: 14.5px; font-weight: 400; letter-spacing: 0; text-transform: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="file"] { padding: 7px 10px; color: var(--soft); }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 6px 14px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer;
  background: #23273a; color: var(--text); font: inherit; font-weight: 600;
}
input::placeholder, textarea::placeholder { color: #5f6580; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25); }
input:disabled { opacity: 0.55; }
select { cursor: pointer; }
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
textarea.prose { font-family: inherit; font-size: 14.5px; line-height: 1.6; field-sizing: content; min-height: 5.5em; max-height: 70vh; }
input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; }
#job-url { flex: 1; min-width: 280px; font-size: 16px; padding: 14px 18px; border-radius: 16px; }
#account-email { flex: 1; min-width: 280px; }
#apply-form { margin-bottom: 20px; }
#apply-form button { padding: 14px 28px; border-radius: 16px; font-size: 16px; }

button {
  background: #23273a; color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 18px; cursor: pointer; font: inherit; font-size: 14.5px; font-weight: 600;
  transition: border-color 0.15s, filter 0.15s, box-shadow 0.15s;
}
button:hover { border-color: rgba(129, 140, 248, 0.5); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary, a.button.primary {
  background: var(--grad); color: #fff; border: 0; box-shadow: 0 0 24px rgba(56, 189, 248, 0.25);
}
button.primary:hover, a.button.primary:hover { filter: brightness(1.1); box-shadow: 0 0 30px rgba(99, 102, 241, 0.45); }
button.danger { background: linear-gradient(90deg, #fb7185, #e11d48); border: 0; color: #fff; }
button.small { padding: 6px 13px; font-size: 13px; border-radius: 10px; margin-left: auto; }
button.link { background: none; border: 0; padding: 0; margin-top: 6px; color: var(--blue); font-size: 13px; font-weight: 500; }
button.link:hover { text-decoration: underline; }
button.danger-text { background: none; border-color: transparent; color: #fda4af; }
button.danger-text:hover { border-color: rgba(244, 63, 94, 0.4); }
a.button { display: inline-block; padding: 10px 18px; border-radius: 12px; background: #23273a; color: var(--text); font-weight: 600; text-decoration: none; }

/* Labels read like small headings: LOCATION, POSTED… */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 18px; }
.fields label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fields label.wide { grid-column: 1 / -1; }
.fields label.check { flex-direction: row; align-items: center; gap: 10px; grid-column: 1 / -1; font-size: 14.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text); }
.hint { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---- Pills, badges, status ------------------------------------------------------------- */
.pill {
  display: inline-block; padding: 3px 11px; margin: 3px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(139, 92, 246, 0.14); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3);
}
.pill.ok { background: rgba(34, 211, 238, 0.1); color: #67e8f9; border-color: rgba(34, 211, 238, 0.3); }
.badge { font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: 999px; border: 1px solid transparent; }
.badge.ok { background: rgba(34, 211, 238, 0.1); color: #67e8f9; border-color: rgba(34, 211, 238, 0.3); }
.badge.no { background: rgba(244, 63, 94, 0.1); color: #fda4af; border-color: rgba(244, 63, 94, 0.3); }
.status-applied { color: var(--ok); font-weight: 600; }
.status-failed, .status-rejected, .status-blocked { color: var(--err); font-weight: 600; }
.status-interview, .status-offer, .status-assessment { color: var(--cyan); font-weight: 700; }

.warning { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.35); color: #fde68a; padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; }
.warning a, .notice a { color: #fff; text-decoration: underline; }
.notice { background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.35); color: #cffafe; padding: 12px 16px; border-radius: 14px; margin-bottom: 14px; }

/* ---- Apply tab -------------------------------------------------------------------------- */
.log {
  height: 62vh; overflow-y: auto; white-space: pre-wrap; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px;
  background: var(--field); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.log div { padding: 1px 0; }
.log .time { color: #5f6580; margin-right: 8px; }
.log .success { color: var(--ok); } .log .warn { color: #fbbf24; } .log .error { color: #fb7185; }
.log .step { color: var(--cyan); font-weight: 600; margin-top: 6px; } .log .dim { color: var(--muted); }
#job-card .card-head { font-size: 21px; font-weight: 800; }
#job-card p { color: var(--soft); }
#files-card p { margin: 8px 0; }

.question {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.5); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.12);
}
.question p { margin: 0 0 12px; font-weight: 600; }
.question input { flex: 1; min-width: 260px; }

/* Live browser */
.live-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-nav { margin-bottom: 12px; }
.live-nav input { flex: 1; min-width: 220px; }
.live-nav button[type="button"] { padding: 9px 13px; }
.live-screen {
  position: relative; max-width: 1280px; margin: 0 auto; background: #000; border: 2px solid var(--line); border-radius: 14px;
  overflow: hidden; outline: none; cursor: pointer; min-height: 160px;
}
.live-screen:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2), 0 0 30px rgba(34, 211, 238, 0.2); }
.live-screen img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.live-empty { padding: 60px 20px; text-align: center; color: var(--muted); cursor: default; }
.live-hint { margin: 10px 0 0; }

/* ---- Profile tab ---------------------------------------------------------------------- */
.entries { display: grid; gap: 12px; }
.entry { background: var(--field); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; transition: border-color 0.15s, box-shadow 0.15s; }
.entry:hover { border-color: rgba(129, 140, 248, 0.35); }
.entry.editing { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.entry-head { display: flex; gap: 12px; align-items: flex-start; }
.entry-head .grow { flex: 1; min-width: 0; }
.entry-title { font-weight: 700; font-size: 16.5px; line-height: 1.35; }
.entry-sub { margin-top: 2px; color: var(--soft); }
.entry-dates { color: var(--muted); font-size: 13px; margin-top: 3px; }
.entry-dates .pill { margin: 0 0 0 6px; font-size: 11px; padding: 1px 9px; }
.entry-tools { display: flex; gap: 6px; flex-shrink: 0; opacity: 0.75; }
.entry:hover .entry-tools { opacity: 1; }
.entry-tools button { padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.entry ul { margin: 12px 0 0; padding-left: 20px; color: var(--soft); }
.entry li { margin: 5px 0; }
.entry li::marker { color: var(--cyan); }
.entry:not(.expanded) li:nth-child(n+4) { display: none; }
.entry .fields { margin-bottom: 4px; }
.entry-actions { margin: 14px 0 0; }
.entry-error { color: #fda4af; margin: 8px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 13px; border-radius: 999px; font-size: 13.5px; background: rgba(99, 102, 241, 0.14); border: 1px solid rgba(129, 140, 248, 0.28); color: #e0e3ff; }
.chip button { background: none; border: 0; padding: 0 8px; color: var(--muted); font-size: 15px; line-height: 1.2; border-radius: 999px; }
.chip button:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.chip-input { border: 1px dashed rgba(129, 140, 248, 0.35); background: none; border-radius: 999px; padding: 5px 14px; font-size: 13.5px; min-width: 180px; }
.chip-input:focus { border-style: solid; }

.saved-qa { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.saved-qa span { flex: 1; color: var(--soft); } .saved-qa input { flex: 1; }

/* Save bar: at the end of the form, floating at the bottom only while there are unsaved changes */
.save-bar { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 12px 18px; margin-top: 4px; }
.save-bar.dirty { position: sticky; bottom: 14px; z-index: 1; border-color: rgba(245, 158, 11, 0.6); box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 30px rgba(245, 158, 11, 0.15); }
.save-bar.dirty #profile-status { color: #fbbf24; }

details > summary { cursor: pointer; font-weight: 700; font-size: 16px; }
details[open] > summary { margin-bottom: 12px; }

/* ---- Applications tab -------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ---- Settings tab ------------------------------------------------------------------------ */
.mailbox { background: var(--field); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.mailbox .row { margin: 10px 0 0; }

/* ---- Plan tab ------------------------------------------------------------------------- */
.price { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.perks { margin: 4px 0 18px; padding-left: 22px; color: var(--soft); }
.perks li { margin: 6px 0; }
.perks li::marker { color: var(--cyan); }
.bar.wide { height: 8px; max-width: 440px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; margin: 8px 0 12px; }
.bar.wide div { height: 100%; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 12px; }
.stats div { background: var(--field); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stats b { display: block; font-size: 24px; font-weight: 800; }
.stats span { color: var(--muted); font-size: 13px; }
#delete-confirm { min-width: 220px; }

/* ---- Notices under the header ------------------------------------------------------------ */
.notice-bar { position: sticky; top: 70px; z-index: 2; margin: 0 28px; background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.35); border-radius: 14px; color: #cffafe; padding: 9px 18px; font-size: 14px; text-align: center; backdrop-filter: blur(10px); }
#idle-banner { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.45); color: #fde68a; cursor: pointer; }

.site-footer { text-align: center; padding: 10px 24px 30px; font-size: 13px; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* ---- Sign-in page --------------------------------------------------------------------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 440px; padding: 36px 32px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--edge); border-radius: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 60px rgba(99, 102, 241, 0.18);
}
.login-card .brand { font-size: 23px; margin-bottom: 22px; }
.login-card h1 { font-size: 26px; font-weight: 800; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; }
.login-card > p.muted { margin: 0 0 18px; font-size: 14.5px; color: var(--soft); }
.login-price { margin: 0 0 22px; font-size: 14px; color: var(--soft); }
.login-price b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 16px; }
.login-error { background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.45); color: #fecdd3; padding: 11px 14px; border-radius: 14px; margin-bottom: 16px; }
.login-card .notice { margin-bottom: 16px; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 13px 16px; border-radius: 14px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; font-size: 15.5px; text-decoration: none; cursor: pointer;
}
.sso-btn:hover { background: #f2f3f7; text-decoration: none; box-shadow: 0 0 24px rgba(99, 102, 241, 0.3); }
.sso-btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.sso-sub { text-align: center; font-size: 12.5px; margin: 6px 0 16px; }
.sso-btn.compact { width: auto; padding: 8px 14px; font-size: 13.5px; gap: 8px; border-radius: 12px; }
.setup-help { background: var(--field); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 6px; }
.setup-help div { margin-top: 6px; word-break: break-all; }
.small-print { font-size: 12.5px; margin: 16px 0 0; }

/* ---- Terms and Privacy pages ------------------------------------------------------------ */
.legal { max-width: 800px; margin: 0 auto; padding: 40px 24px 60px; }
.legal h1 { font-size: 34px; font-weight: 800; margin: 22px 0 4px; letter-spacing: -0.01em; }
.legal h2 { font-size: 19px; font-weight: 700; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--soft); line-height: 1.65; }
.legal li { margin: 5px 0; }
.legal li::marker { color: var(--cyan); }

@media (max-width: 860px) {
  header { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  nav { order: 3; width: 100%; overflow-x: auto; margin: 0; }
  main { padding: 18px 16px; }
  #apply-form { flex-wrap: nowrap; }
  #job-url { min-width: 0; }
  #apply-form button { padding: 14px 18px; }
  .card { padding: 18px; border-radius: 18px; }
  .notice-bar { margin: 0 16px; top: 118px; }
}
