/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1.25rem;
}

.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 2.5rem 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 12px 40px rgba(0,0,0,0.22),
    0 32px 80px rgba(0,0,0,0.14);
}

/* Brand bar */
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.login-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0071e3, #0058b3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,113,227,0.35);
}

.login-logo-text { display: flex; flex-direction: column; gap: 1px; }

.login-brand {
  font-weight: 700;
  font-size: 0.975rem;
  color: #1d1d1f;
  letter-spacing: -0.3px;
  line-height: 1;
}

.login-sub {
  font-size: 0.7rem;
  color: #8e8e93;
  line-height: 1;
  letter-spacing: 0.1px;
}

.login-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0 0 1.5rem;
}

.login-heading {
  font-size: 1.45rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.3rem;
  letter-spacing: -0.4px;
}

.login-desc {
  font-size: 0.845rem;
  color: #6b7280;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

/* Form */
#loginForm { display: flex; flex-direction: column; gap: 1.1rem; }

/* Field group */
.lf-group { display: flex; flex-direction: column; gap: 0.4rem; }

.lf-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.1px;
}

/* Input wrapper with icon */
.lf-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lf-icon {
  position: absolute;
  left: 0.875rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.15s;
}

.lf-input {
  width: 100%;
  padding: 0.6rem 0.875rem 0.6rem 2.625rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #111827;
  background: #f9fafb;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  -webkit-appearance: none;
}

.lf-input::placeholder { color: #9ca3af; }

.lf-input:focus {
  background: #fff;
  border-color: #0071e3;
  box-shadow: 0 0 0 3.5px rgba(0, 113, 227, 0.15);
}

.lf-input:focus ~ .lf-icon,
.lf-input-wrap:focus-within .lf-icon { color: #0071e3; }

/* Password has right padding for eye button */
#password { padding-right: 2.75rem; }

/* Eye toggle */
.lf-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  padding: 0.2rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.lf-eye:hover { color: #374151; }

/* Error message */
.lf-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.845rem;
  line-height: 1.4;
}

.lf-error svg { flex-shrink: 0; }

/* Submit button */
.lf-submit {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.925rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, #0071e3 0%, #005bbf 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.1px;
  transition: filter 0.15s, opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 2px 8px rgba(0,113,227,0.25);
  margin-top: 0.25rem;
}

.lf-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 2px 4px rgba(0,0,0,0.12), 0 4px 16px rgba(0,113,227,0.35);
}

.lf-submit:active:not(:disabled) { filter: brightness(0.96); }

.lf-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* Footer */
.login-footer {
  text-align: center;
  margin-top: 1.625rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f3f4f6;
}

.login-footer a {
  font-size: 0.825rem;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s;
}

.login-footer a:hover { color: #0071e3; }

/* Copyright below card */
.login-copyright {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.28);
  text-align: center;
  max-width: 340px;
  line-height: 1.6;
}


/* ============================================================
   SIGN DOCUMENT PAGE
   ============================================================ */

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  margin-top: -0.4rem;
  line-height: 1.5;
}

.file-types {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.file-icon { font-size: 2.25rem; line-height: 1; }

.file-details { display: flex; flex-direction: column; gap: 0.2rem; }

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.file-size { font-size: 0.8rem; color: var(--text-muted); }

/* Metadata table */
.meta-grid {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.meta-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.meta-row:last-child { border-bottom: none; }

.meta-key {
  padding: 0.6rem 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border-right: 1px solid var(--border);
  align-self: start;
  white-space: nowrap;
}

.meta-val {
  padding: 0.6rem 0.875rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.5;
}

.meta-val.small {
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.meta-val.muted {
  color: var(--text-muted);
  font-style: italic;
}

.meta-val.dynamic { color: var(--accent); font-weight: 500; }

.meta-val.dynamic.empty { color: var(--text-muted); font-weight: 400; font-style: italic; }

/* Sign button */
.btn-sign {
  background: #0f172a;
  color: #fff;
  width: 100%;
  padding: 0.85rem;
  font-size: 0.975rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
  letter-spacing: 0.15px;
}

.btn-sign:hover:not(:disabled) { background: #1e293b; }
.btn-sign:disabled { opacity: 0.4; cursor: not-allowed; }

/* Section step numbers */
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

.card h2 { display: flex; align-items: center; }
