:root {
  --bg: #f2f6fa;
  --panel: #ffffff;
  --panel-border: #d2dce8;
  --text: #10243a;
  --muted: #5f738b;
  --accent: #1c6dd0;
  --accent-dark: #164f95;
  --danger: #b42828;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background: linear-gradient(170deg, #dce9f7 0%, var(--bg) 40%, #ecf2f8 100%);
  color: var(--text);
}

.container {
  width: min(960px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
}

.hero-logo {
  width: min(132px, 35vw);
  height: auto;
  display: block;
}

.hero h1 {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}

.hero p {
  margin-top: 0;
  color: var(--muted);
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.1rem;
  margin-top: 1rem;
  box-shadow: 0 10px 30px rgba(19, 43, 68, 0.06);
}

h2 {
  margin-top: 0;
}

h3 {
  margin: 0;
}

form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  border: 1px solid #b8c9dd;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

button {
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  padding: 0.6rem 0.8rem;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

.verified-email {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.verified-email label {
  grid-column: 1 / -1;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.checkbox input {
  width: auto;
}

.muted {
  color: var(--muted);
}

.consent-copy {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d6e0ec;
  border-radius: 8px;
  background: #f7faff;
}

#preview-frame {
  width: 100%;
  min-height: 460px;
  border: 1px solid #ced9e7;
  border-radius: 8px;
  background: #f8fbff;
}

.status {
  margin: 0;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.signature-pad {
  width: 100%;
  min-height: 180px;
  border: 1px dashed #9db2c9;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

#clear-signature {
  width: fit-content;
  background: #5f738b;
}

#clear-signature:hover {
  background: #4a5e74;
}

#download-button {
  width: 100%;
  margin-top: 0.75rem;
}

.schedule-a {
  margin-top: 0.35rem;
  border: 1px solid #d6e0ec;
  border-radius: 10px;
  padding: 0.75rem;
  background: #f8fbff;
  overflow-x: auto;
}

.schedule-a-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

#edit-schedule-a {
  width: auto;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
}

.hardware-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.35rem;
}

.hardware-table th,
.hardware-table td {
  border: 1px solid #c9d6e6;
  padding: 0.45rem;
  text-align: left;
  vertical-align: middle;
}

.hardware-table th {
  background: #ecf3fb;
  font-size: 0.85rem;
}

.hardware-table td {
  font-size: 0.9rem;
}

.hardware-table input {
  width: 100%;
  min-width: 90px;
}

.hardware-total-row td {
  font-weight: 700;
  background: #f1f6fd;
}

.ui-blocker {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(16, 36, 58, 0.42);
  backdrop-filter: blur(2px);
}

.ui-blocker[hidden] {
  display: none !important;
}

.ui-blocker-card {
  min-width: 240px;
  max-width: 340px;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 1px solid #d2dce8;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(16, 36, 58, 0.2);
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}

.ui-blocker-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #24405f;
}

.ui-blocker-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #cfddf1;
  border-top-color: #1c6dd0;
  animation: ui-spin 0.8s linear infinite;
}

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

@media (max-width: 640px) {
  .container {
    width: calc(100% - 1rem);
    margin-top: 1rem;
  }

  .card {
    padding: 0.9rem;
  }

  #preview-frame {
    min-height: 320px;
  }
}
