/* ============================================================
   WIS Document Portal — Stylesheet
   Brand: #1A3C5E (navy blue) · #E8F0F7 (light blue)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #1A3C5E;
  --lblue:   #E8F0F7;
  --accent:  #2E86C1;
  --gray:    #555;
  --lgray:   #888;
  --border:  #DDE3EA;
  --red:     #C0392B;
  --green:   #1A7A44;
  --white:   #FFFFFF;
  --bg:      #F4F7FB;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(26,60,94,0.10);
}

html, body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  color: #1A1A1A;
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layouts ─────────────────────────────────────────────── */
body.layout-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f2744 0%, #1A3C5E 60%, #2E6DA4 100%);
}

body.layout-dashboard { background: var(--bg); }
body.layout-form       { background: var(--bg); }
body.layout-success    { background: var(--bg); }

/* ── Login ───────────────────────────────────────────────── */
.login-box {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  border-radius: 12px;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.login-box h1 { font-size: 22px; color: var(--blue); margin-bottom: 6px; }
.subtitle      { color: var(--gray); font-size: 13px; margin-bottom: 24px; }

.login-box form { text-align: left; }
.login-box label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
  margin-top: 16px;
}
.login-box input[type=text],
.login-box input[type=password],
.login-box input[type=email] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color .2s;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-note { font-size: 12px; color: var(--lgray); margin-top: 20px; line-height: 1.6; }

/* ── Portal header ───────────────────────────────────────── */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--blue);
  color: #fff;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.portal-brand     { display: flex; align-items: center; gap: 14px; }
.portal-header .logo-mark { width: 40px; height: 40px; font-size: 13px; margin: 0; border-radius: 8px; }
.portal-title     { font-size: 16px; font-weight: 700; color: #fff; }
.portal-sub       { font-size: 11px; color: rgba(255,255,255,0.65); }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 24px 60px;
}
.dashboard h2  { color: var(--blue); font-size: 22px; margin-bottom: 8px; }
.intro         { color: var(--gray); font-size: 14px; margin-bottom: 28px; line-height: 1.7; }

.doc-list { display: flex; flex-direction: column; gap: 14px; }

.doc-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  text-decoration: none;
  color: inherit;
}
.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(46,134,193,0.15);
  transform: translateY(-2px);
  text-decoration: none;
}
.doc-icon   { font-size: 28px; flex-shrink: 0; }
.doc-info   { flex: 1; }
.doc-info h3 { font-size: 15px; color: var(--blue); margin-bottom: 4px; }
.doc-info p  { font-size: 13px; color: var(--gray); }
.doc-arrow   { font-size: 20px; color: var(--accent); flex-shrink: 0; }

.contact-bar {
  margin-top: 36px;
  padding: 14px 20px;
  background: var(--lblue);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--gray);
  text-align: center;
}

/* ── Form container ──────────────────────────────────────── */
.form-container {
  max-width: 780px;
  margin: 36px auto;
  padding: 0 24px 80px;
}
.doc-header { margin-bottom: 28px; }
.doc-header h2 { color: var(--blue); font-size: 20px; margin-bottom: 6px; }
.doc-header p  { color: var(--gray); font-size: 14px; }

.form-section {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.form-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
}

.field-row   { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.field-group { flex: 1; min-width: 220px; }
.field-group.full { flex: 0 0 100%; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.req { color: var(--red); }

input[type=text], input[type=email], input[type=tel],
input[type=date], input[type=password], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #FAFBFD;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.12);
  background: #fff;
}
input[readonly] { background: var(--lblue); color: var(--gray); cursor: default; }
textarea { resize: vertical; min-height: 90px; }

/* ── Signature ───────────────────────────────────────────── */
.sig-section .sig-note { font-size: 13px; color: var(--gray); margin-bottom: 14px; line-height: 1.6; }
.sig-wrap {
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  width: 100%;
  max-width: 620px;
  cursor: crosshair;
  position: relative;
}
.sig-wrap::after {
  content: 'Sign here';
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #D0D8E2;
  font-size: 13px;
  pointer-events: none;
}
#sigCanvas { display: block; width: 100%; height: 180px; touch-action: none; }
.sig-actions { margin-top: 10px; }

/* ── Checkbox ────────────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.checkbox-label input[type=checkbox] {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--blue);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, transform .15s;
  text-decoration: none;
}
.btn-primary:hover { background: #122C45; transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border: 1.5px solid var(--blue);
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--lblue); text-decoration: none; }
.btn-submit  { width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.btn-logout  {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,0.22); text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
}
.alert-error { background: #FEF0F0; color: var(--red); border: 1px solid #F8C0C0; }

/* ── Success ─────────────────────────────────────────────── */
.success-box {
  max-width: 580px;
  margin: 60px auto;
  background: var(--white);
  border: 1.5px solid #B8E2C8;
  border-radius: 14px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.success-icon  { font-size: 48px; margin-bottom: 18px; }
.success-box h2 { color: var(--green); font-size: 22px; margin-bottom: 12px; }
.success-box p  { color: var(--gray); font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.filename       { font-family: monospace; font-size: 12px; color: var(--lgray); background: #F4F7FB; padding: 6px 12px; border-radius: 4px; display: inline-block; margin: 6px 0; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-container {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 24px;
}
.admin-container h2 { color: var(--blue); font-size: 20px; margin-bottom: 20px; }
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 10px;
  gap: 16px;
}
.admin-filename { font-size: 13px; font-family: monospace; color: var(--gray); word-break: break-all; }
.empty { color: var(--lgray); font-size: 14px; margin-top: 20px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .portal-header { padding: 12px 16px; }
  .dashboard, .form-container { padding: 0 14px 60px; }
  .form-section { padding: 18px 16px; }
  .field-row  { flex-direction: column; }
  .field-group { min-width: unset; }
  .sig-wrap, #sigCanvas { height: 140px; }
  .login-box { padding: 32px 24px; }
}
