/* ============================================================================
   Employee Reimbursement Portal — public upload page
   Style: split-screen, brand mesh, floating card (aligned with login.css tokens)
   ============================================================================ */

:root {
  --brand-400: oklch(0.78 0.14 178);
  --brand-500: oklch(0.72 0.14 180);
  --brand-600: oklch(0.63 0.13 182);
  --brand-700: oklch(0.54 0.11 184);
  --brand-800: oklch(0.44 0.09 186);

  --ink-0:   oklch(1 0 0);
  --ink-25:  oklch(0.992 0.003 85);
  --ink-50:  oklch(0.985 0.004 85);
  --ink-100: oklch(0.97 0.005 85);
  --ink-200: oklch(0.92 0.008 240);
  --ink-300: oklch(0.85 0.012 240);
  --ink-400: oklch(0.66 0.018 240);
  --ink-500: oklch(0.52 0.02 240);
  --ink-600: oklch(0.42 0.025 240);
  --ink-700: oklch(0.32 0.03 240);
  --ink-800: oklch(0.22 0.035 240);
  --ink-900: oklch(0.14 0.04 248);

  --error:   oklch(0.62 0.21 25);
  --success: oklch(0.65 0.17 155);

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;

  --shadow-float:
    0 1px 2px oklch(0 0 0 / 0.04),
    0 8px 24px oklch(0 0 0 / 0.06),
    0 24px 64px oklch(0.44 0.09 186 / 0.08);

  --shadow-card:
    0 1px 2px oklch(0 0 0 / 0.04),
    0 4px 12px oklch(0 0 0 / 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--ink-50);
  color: var(--ink-800);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Unified mesh background — spans both halves */
body {
  background:
    radial-gradient(1200px 800px at 15% 25%, oklch(0.95 0.04 180 / 0.55), transparent 55%),
    radial-gradient(900px 700px at 85% 75%, oklch(0.92 0.05 186 / 0.45), transparent 55%),
    radial-gradient(700px 500px at 50% 100%, oklch(0.96 0.03 82 / 0.5), transparent 55%),
    linear-gradient(180deg, var(--ink-25) 0%, var(--ink-100) 100%);
}

/* ============================================================================
   Shell — split layout
   ============================================================================ */

.portal-shell {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.1fr);
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .portal-shell { grid-template-columns: 1fr; }
}

/* ============================================================================
   LEFT — Brand panel
   ============================================================================ */

.portal-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: var(--ink-800);
  position: relative;
}

@media (max-width: 900px) {
  .portal-brand { padding: 32px 24px 8px; }
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

.logo-box {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: var(--ink-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px oklch(0.54 0.11 184 / 0.28);
}
.logo-box svg { width: 20px; height: 20px; }

.brand-hero {
  margin-top: 56px;
  max-width: 460px;
}

@media (max-width: 900px) {
  .brand-hero { margin-top: 24px; }
}

.brand-hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: var(--ink-900);
}

.hero-line { display: block; }
.line-1 { color: var(--ink-700); font-weight: 500; }
.line-2 {
  background: linear-gradient(95deg, var(--brand-700), var(--brand-500) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tagline {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-600);
  margin: 0;
  max-width: 420px;
}
.brand-tagline strong {
  color: var(--ink-800);
  font-weight: 600;
}

/* Steps */
.brand-steps {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  gap: 16px;
  max-width: 420px;
}

.brand-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--ink-0);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.step-dot {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: var(--ink-0);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.brand-steps strong {
  display: block;
  font-weight: 600;
  color: var(--ink-900);
  font-size: 14px;
  letter-spacing: -0.005em;
}
.brand-steps span {
  display: block;
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 2px;
}

/* Brand footer */
.brand-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-500);
}
.ap-tag strong { color: var(--ink-700); font-weight: 600; }
.version {
  font-family: "Space Grotesk", sans-serif;
  padding: 3px 8px;
  background: var(--ink-100);
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* ============================================================================
   RIGHT — Form panel
   ============================================================================ */

.portal-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px;
}

@media (max-width: 900px) {
  .portal-form { padding: 16px; }
}

.form-card {
  width: 100%;
  max-width: 520px;
  background: var(--ink-0);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-float);
  border: 1px solid oklch(1 0 0 / 0.4);
  padding: 36px 40px;
}

@media (max-width: 640px) {
  .form-card { padding: 24px 20px; border-radius: var(--r-lg); }
}

.form-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  margin: 0 0 6px;
}
.form-head p {
  font-size: 13px;
  color: var(--ink-500);
  margin: 0 0 24px;
}

.req-mark {
  color: var(--error);
  font-weight: 600;
  margin-left: 2px;
}

/* Honeypot — invisible to humans */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ============================================================================
   Fields
   ============================================================================ */

.form-body {
  display: grid;
  gap: 18px;
}

.field {
  display: block;
  border: 0;
  padding: 0;
  margin: 0;
}

fieldset.field legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--ink-0);
  border: 1px solid var(--ink-300);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

.field input:hover, .field textarea:hover {
  border-color: var(--ink-400);
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px oklch(0.72 0.14 180 / 0.15);
}

.field input:invalid:not(:placeholder-shown),
.field textarea:invalid:not(:placeholder-shown) {
  border-color: var(--error);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-500);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ============================================================================
   Dropzone
   ============================================================================ */

.dropzone {
  border: 2px dashed var(--ink-300);
  border-radius: var(--r-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: oklch(0.98 0.005 180 / 0.5);
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--brand-500);
  background: oklch(0.96 0.02 180 / 0.5);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--brand-600);
  background: oklch(0.94 0.04 180 / 0.6);
  transform: scale(1.01);
}

.dz-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--brand-600);
}

.dz-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-800);
  margin: 0 0 4px;
}

.dz-hint {
  font-size: 12px;
  color: var(--ink-500);
  margin: 0;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  background: oklch(0.97 0.02 180 / 0.4);
  border: 1px solid oklch(0.82 0.04 180);
  border-radius: var(--r-md);
}

.fp-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: var(--ink-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.fp-meta { flex: 1; min-width: 0; }
.fp-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-size {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-500);
}

.fp-clear {
  background: transparent;
  border: 0;
  padding: 6px;
  border-radius: var(--r-sm);
  color: var(--ink-500);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.fp-clear:hover { color: var(--error); background: oklch(0.95 0.02 25 / 0.4); }
.fp-clear svg { width: 16px; height: 16px; display: block; }

/* ============================================================================
   Consent + actions
   ============================================================================ */

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-600);
  padding: 12px 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
}

.consent input[type="checkbox"] {
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--brand-600);
  width: 16px;
  height: 16px;
}

.consent a {
  color: var(--brand-700);
  text-decoration: underline;
  text-decoration-color: oklch(0.72 0.14 180 / 0.4);
  text-underline-offset: 2px;
}
.consent a:hover { text-decoration-color: var(--brand-600); }

.form-actions {
  margin-top: 6px;
}

.btn-primary {
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: var(--ink-0);
  border: 0;
  border-radius: var(--r-md);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 16px oklch(0.54 0.11 184 / 0.24);
  transition: transform 120ms ease, box-shadow 160ms ease, filter 120ms ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px oklch(0.54 0.11 184 / 0.32);
}
.btn-primary:active { transform: translateY(0); filter: brightness(0.96); }
.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  display: none;
  animation: btn-spin 0.8s linear infinite;
}
.btn-primary.is-loading .btn-label { opacity: 0.7; }
.btn-primary.is-loading .btn-spinner { display: inline-block; }

@keyframes btn-spin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

.privacy-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--ink-500);
  text-align: center;
}

.btn-secondary {
  padding: 10px 18px;
  background: var(--ink-0);
  color: var(--brand-700);
  border: 1px solid var(--brand-500);
  border-radius: var(--r-md);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn-secondary:hover { background: oklch(0.96 0.03 180 / 0.6); }

/* ============================================================================
   Success state
   ============================================================================ */

.form-success {
  text-align: center;
  padding: 12px 0 4px;
  animation: fade-in 280ms ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.82 0.14 155), oklch(0.68 0.17 155));
  color: var(--ink-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px oklch(0.65 0.17 155 / 0.28);
}
.success-icon svg { width: 30px; height: 30px; }

.form-success h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--ink-900);
  margin: 0 0 8px;
}

.form-success p {
  font-size: 14px;
  color: var(--ink-600);
  margin: 0 0 8px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.success-ref {
  margin-top: 16px !important;
  font-size: 13px !important;
  color: var(--ink-500) !important;
}
.success-ref strong {
  font-family: "Space Grotesk", sans-serif;
  color: var(--brand-700);
  letter-spacing: 0.02em;
}

.form-success .btn-secondary {
  margin-top: 16px;
}
