:root {
  --navy: #2F5897;
  --navy-deep: #1f3c6b;
  --teal: #14b8a6;
  --ink: #2b2f36;
  --muted: #8a8f98;
  --line: #e3e8f0;
  --bg: #eef2f8;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 50% -180px, rgba(47, 88, 151, .10), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 26px; background: #fff;
  box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(20, 40, 80, .05);
}
.topbar .logo { height: 30px; }
.topbar span { font-weight: 650; color: var(--navy); letter-spacing: .2px; }
.topbar .logout { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar .logout:hover { color: var(--navy); }

main { max-width: 880px; margin: 34px auto; padding: 0 20px; }

/* ---- dropzone ---- */
.dropzone {
  background: #fff; border: 2px dashed #c4cfe2; border-radius: 18px;
  padding: 60px 28px; text-align: center; color: var(--muted);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: 0 10px 34px rgba(20, 40, 80, .06);
}
.dropzone .big { font-size: 18px; color: var(--ink); margin: 0 0 6px; }
.dropzone.over { border-color: var(--teal); box-shadow: 0 0 0 5px rgba(20, 184, 166, .16); transform: translateY(-2px); }
.hint { font-size: 13px; margin-top: 8px; }
.link { color: var(--teal); cursor: pointer; font-weight: 650; }
.link:hover { text-decoration: underline; }

.spinner { text-align: center; color: var(--navy); font-weight: 650; padding: 64px; position: relative; }
.spinner::before {
  content: ""; display: block; width: 30px; height: 30px; margin: 0 auto 16px;
  border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- review controls ---- */
.row { display: flex; gap: 12px; align-items: center; margin: 16px 0; }
.row.spread { justify-content: space-between; }
h2 { font-size: 17px; color: var(--navy); margin: 4px 0; }
h2 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.reset { background: none; border: 0; font-size: 13px; padding: 0; box-shadow: none; }

textarea {
  width: 100%; border: 1px solid #d3dbe8; border-radius: 12px; padding: 13px 14px;
  font: inherit; resize: vertical; background: #fff;
}
textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }

button {
  background: linear-gradient(180deg, var(--navy), var(--navy-deep)); color: #fff;
  border: 0; border-radius: 11px; padding: 12px 22px; font-weight: 650; font-size: 14.5px;
  cursor: pointer; box-shadow: 0 3px 12px rgba(47, 88, 151, .28); transition: transform .12s, box-shadow .12s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(47, 88, 151, .34); }
button.ghost { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px #c4cfe2; }
button.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--teal); }
button:disabled { opacity: .6; cursor: default; transform: none; }

/* ---- the live profile preview (paper) ---- */
.preview {
  background: #fff; border-radius: 14px; padding: 40px 46px; margin-top: 10px;
  box-shadow: 0 14px 40px rgba(20, 40, 80, .10); border-top: 4px solid var(--navy);
}
.preview h1 { color: var(--navy); font-size: 25px; margin: 0 0 2px; letter-spacing: -.2px; }
.preview .li { color: var(--teal); margin: 0 0 8px; font-size: 13px; }
.preview h3 {
  color: var(--navy); text-transform: uppercase; letter-spacing: 1.1px; font-size: 12.5px;
  border-bottom: 1px solid var(--line); padding-bottom: 5px; margin: 22px 0 9px;
}
.preview p { margin: 5px 0; }
.preview .muted { color: var(--muted); font-size: 13px; }
.preview ul { margin: 7px 0 12px 18px; }
.preview li { margin: 3px 0; }

/* ---- editable fields ---- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 10px 0 4px; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fld input { border: 1px solid #d3dbe8; border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.fld input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); align-self: end; padding-bottom: 10px; }
.chk input { width: 16px; height: 16px; accent-color: var(--teal); }
h2.mt { margin-top: 18px; }

/* ---- recent profiles ---- */
.recent { margin-top: 30px; }
.recent h2 { font-size: 16px; color: var(--navy); margin-bottom: 8px; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; box-shadow: 0 3px 14px rgba(20, 40, 80, .06); }
.recent-list li.empty { color: var(--muted); box-shadow: none; background: transparent; padding-left: 0; }
.recent-list .ri { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-list .ri b { color: var(--ink); }
.recent-list .when { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .ra { display: flex; gap: 8px; flex-shrink: 0; }
button.sm { padding: 7px 13px; font-size: 13px; box-shadow: inset 0 0 0 1px #c4cfe2; }
button.sm.del:hover { box-shadow: inset 0 0 0 1.5px #c0392b; color: #c0392b; }

/* ---- PDF preview modal ---- */
.modal { position: fixed; inset: 0; background: rgba(20, 30, 50, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal-inner { background: #fff; border-radius: 14px; width: min(900px, 96vw); height: 92vh; position: relative; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); overflow: hidden; }
.modal-inner iframe { width: 100%; height: 100%; border: 0; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--navy); color: #fff; border: 0; border-radius: 50%; width: 34px; height: 34px; font-size: 15px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); padding: 0; }

.hidden { display: none; }

/* ---- login ---- */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.card {
  background: #fff; padding: 40px 36px; border-radius: 18px;
  box-shadow: 0 18px 60px rgba(20, 40, 80, .16); width: 330px; text-align: center;
  border-top: 4px solid var(--teal);
}
.card .logo { height: 40px; margin-bottom: 10px; }
.card h1 { color: var(--navy); font-size: 21px; margin: 6px 0 20px; }
.card input { width: 100%; padding: 12px; border: 1px solid #d3dbe8; border-radius: 11px; margin-bottom: 12px; font: inherit; }
.card input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, .15); }
.card button { width: 100%; }
.err { color: #c0392b; font-size: 13px; margin: 0 0 12px; }
