/* ==========================================================================
   CIPHER KNIGHTS — FORMS, BUTTONS, BADGES & MODALS
   The client portal and the signing room referenced `.form-control`,
   `.form-group`, `.btn-primary-cobalt`, `.ck-badge` and the modal shell, none
   of which had any CSS. Those pages were rendering as raw browser defaults.
   This file defines them once, for both.
   ========================================================================== */

:root {
  /* Aliases used by the portal and signing-room templates. */
  --brand-primary:       var(--accent-green);
  --brand-primary-glow:  rgba(0, 93, 170, 0.35);
  --border-subtle:       var(--brand-border);
}

/* --- form scaffolding --------------------------------------------------- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-label .req,
.form-label .required { color: var(--accent-on-dark); }

.form-control {
  display: block;
  width: 100%;
  background: var(--brand-black);
  border: 1px solid var(--brand-border-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  padding: 13px 15px;
  border-radius: 2px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder { color: var(--text-muted); opacity: 1; }
.form-control:hover { border-color: var(--brand-border-light); }
.form-control:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 93, 170, 0.28);
}
.form-control:disabled { opacity: 0.55; cursor: not-allowed; }

textarea.form-control { min-height: 120px; resize: vertical; }

/* Native select needs its own arrow once appearance is stripped. */
select.form-control {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 19px) 51%, calc(100% - 14px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
  cursor: pointer;
}
select.form-control option { background: var(--brand-black); color: var(--text-primary); }

input[type="file"].form-control { padding: 10px 12px; cursor: pointer; }
input[type="file"].form-control::file-selector-button {
  background: var(--brand-panel);
  border: 1px solid var(--brand-border-light);
  color: var(--text-secondary);
  padding: 7px 14px;
  margin-right: 12px;
  border-radius: 2px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
input[type="file"].form-control::file-selector-button:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.form-error { font-size: 12px; color: #FF6B6B; margin-top: 6px; }
.form-group.has-error .form-control { border-color: #FF6B6B; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

/* --- buttons ------------------------------------------------------------ */
.btn-primary-cobalt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-green);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-base), transform var(--transition-base),
              box-shadow var(--transition-base);
}
.btn-primary-cobalt:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 93, 170, 0.4);
}
.btn-primary-cobalt:active { transform: translateY(0); }
.btn-primary-cobalt:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-outline-cyber {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 26px;
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
}
.btn-outline-cyber:hover {
  border-color: var(--accent-green);
  color: var(--accent-on-dark);
  background: rgba(0, 93, 170, 0.1);
}

/* --- badges ------------------------------------------------------------- */
.ck-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid var(--brand-border-light);
  color: var(--text-secondary);
}
.ck-badge-cyan {
  color: var(--accent-cyan);
  border-color: rgba(0, 194, 199, 0.45);
  background: rgba(0, 194, 199, 0.1);
}
.ck-badge-cobalt {
  color: var(--accent-on-dark);
  border-color: rgba(0, 93, 170, 0.55);
  background: rgba(0, 93, 170, 0.14);
}

/* --- auth card ---------------------------------------------------------- */
.auth-shell {
  min-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
}
.auth-card {
  width: 100%;
  background: var(--brand-card);
  border: 1px solid var(--brand-border);
  border-top: 3px solid var(--accent-green);
  padding: 40px 42px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
@media (max-width: 560px) { .auth-card { padding: 30px 22px; } }

.auth-head { text-align: center; margin-bottom: 30px; }
.auth-head img { height: 42px; width: auto; margin-bottom: 14px; }
.auth-head h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 12px 0 8px;
  line-height: 1.25;
}
.auth-head p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 auto;
  max-width: 42ch;
}
.auth-foot {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--brand-border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-foot a { color: var(--accent-on-dark); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* --- modal shell -------------------------------------------------------- */
.ck-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.ck-modal-backdrop.active { opacity: 1; visibility: visible; }

.ck-modal-box {
  width: 100%;
  max-width: 620px;
  background: var(--brand-card);
  border: 1px solid var(--brand-border-light);
  border-top: 3px solid var(--accent-green);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  transform: translateY(-12px);
  transition: transform var(--transition-base);
  margin: auto;
}
.ck-modal-backdrop.active .ck-modal-box { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--brand-border);
}
.modal-header h3 { color: var(--text-primary); font-size: 1.05rem; font-weight: 600; margin: 0; }
.modal-header p { color: var(--text-muted); font-size: 12.5px; margin: 3px 0 0; }

.modal-close-btn {
  background: transparent;
  border: 1px solid var(--brand-border-light);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 2px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.modal-close-btn:hover { border-color: #FF6B6B; color: #FF6B6B; }

.modal-body { padding: 24px 26px 26px; }
