/* AiSign brand styles - shared by the landing, signing and tracking pages. */

:root {
  --brand-800: #063f3f;
  --brand-700: #085656;
  --brand-600: #0a6e6e;
  --brand-500: #0e8c8c;
  --brand-100: #e2f2f2;
  --brand-050: #f0f8f8;

  --ink: #0f1720;
  --ink-soft: #33424f;
  --muted: #64748b;
  --muted-soft: #94a3b8;

  --surface: #ffffff;
  --surface-2: #f7fafb;
  --bg: #eef3f5;
  --border: #dde5ea;
  --border-strong: #c3cfd7;

  --success: #12805c;
  --success-bg: #e7f6ef;
  --warning: #b45309;
  --warning-bg: #fdf3e3;
  --danger: #b42318;
  --danger-bg: #fdeceb;
  --info: #1d4ed8;
  --info-bg: #eaefff;

  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 32, 0.06);
  --shadow: 0 6px 20px rgba(15, 23, 32, 0.08);
  --shadow-lg: 0 18px 44px rgba(15, 23, 32, 0.14);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9eef3;
    --ink-soft: #c2ccd6;
    --muted: #94a3b8;
    --muted-soft: #74808f;
    --surface: #131b21;
    --surface-2: #18222a;
    --bg: #0d1418;
    --border: #26333c;
    --border-strong: #384852;
    --brand-100: #10312f;
    --brand-050: #0e2726;
    --success-bg: #0f2a22;
    --warning-bg: #2c2113;
    --danger-bg: #2c1a18;
    --info-bg: #16203a;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.5);
  }
}

[data-theme='dark'] {
  --ink: #e9eef3;
  --ink-soft: #c2ccd6;
  --muted: #94a3b8;
  --surface: #131b21;
  --surface-2: #18222a;
  --bg: #0d1418;
  --border: #26333c;
  --border-strong: #384852;
  --brand-100: #10312f;
  --brand-050: #0e2726;
}

[data-theme='light'] {
  --ink: #0f1720;
  --ink-soft: #33424f;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --bg: #eef3f5;
  --border: #dde5ea;
  --border-strong: #c3cfd7;
}

* {
  box-sizing: border-box;
}

/* The [hidden] attribute must win over the layout display values used below
   (a flex container would otherwise stay visible even when hidden). */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1,
h2,
h3 {
  margin: 0 0 0.4em;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1rem;
}

p {
  margin: 0 0 0.8em;
}

a {
  color: var(--brand-600);
}

/* --- Brand mark ---------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-600);
  text-decoration: none;
}

.brand svg {
  display: block;
  flex: none;
}

.brand span {
  font-size: 1.15rem;
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand-600);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--brand-700);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* --- Cards and layout ---------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.pad {
  padding: 20px;
}

.stack > * + * {
  margin-top: 14px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.mono {
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
}

/* --- Notices ------------------------------------------------------------- */

.notice {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  border: 1px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notice-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--ink);
}
.notice-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--ink);
}
.notice-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--ink);
}
.notice-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-draft {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border-strong);
}
.badge-sent {
  background: var(--info-bg);
  color: var(--info);
}
.badge-completed {
  background: var(--success-bg);
  color: var(--success);
}
.badge-declined,
.badge-canceled {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-expired {
  background: var(--warning-bg);
  color: var(--warning);
}

/* --- Forms --------------------------------------------------------------- */

label.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='date'],
input[type='number'],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 1px;
  border-color: var(--brand-500);
}

input[aria-invalid='true'] {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border-color: var(--border-strong);
  border-top-color: var(--brand-600);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
