/* #region Root Variables */
:root {
  --bg: #f5f7fb;
  --card: #fff;
  --text: #172033;
  --muted: #667085;
  --line: #d8dee9;
  --accent: #1f5eff;
  --accent-soft: #e9efff;
  --danger: #b42318;
  --good: #067647;
  --shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
}
/* #endregion */

/* #region Global Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
/* #endregion */

/* #region Header */
header {
  background: #111827;
  color: #fff;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow);
}

header h1 {
  margin: 0;
  font-size: 21px;
}

header p {
  margin: 5px 0 0;
  color: #cbd5e1;
  font-size: 13px;
}
/* #endregion */

/* #region Main Layout */
.top-bar {
  display: flex;
  justify-content: flex-start;
  padding: 12px 20px 0;
}

.layout {
  display: grid;
  grid-template-columns: 285px 1fr;
  min-height: calc(100vh - 78px);
}

aside {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 16px;
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  overflow: auto;
}

main {
  padding: 24px;
  max-width: 1180px;
  width: 100%;
}
/* #endregion */

/* #region Navigation */
.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  font-weight: 700;
  color: #344054;
  cursor: pointer;
}

.nav button.active,
.nav button:hover {
  background: var(--accent-soft);
  color: #123ea7;
}

.nav-item.complete::before {
  content: "\2713 ";
  color: #16a34a;
  font-weight: 700;
}

.nav-item.incomplete::before {
  content: "\25CB ";
  color: #9ca3af;
  font-weight: 700;
}
/* #endregion */

/* #region Section Containers */
.form-navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;

  margin-top: 32px;
  padding-top: 24px;
}

.tools,
.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.tools {
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section {
  margin-bottom: 18px;
  overflow: hidden;
}

.client-save-note {
  margin: 10px 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  line-height: 1.5;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block !important;
}

.section-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
/* #endregion */

/* #region Form Layout */
.fields {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 15px 18px;
}

.fields input,
.fields select {
  height: 44px;
  box-sizing: border-box;
}

.full {
  grid-column: 1/-1;
}

label {
  font-size: 13px;
  font-weight: 700;
  color: #344054;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.req::after {
  content: " *";
  color: var(--danger);
}
/* #endregion */

/* #region Inputs */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #bfd2ff;
  border-color: var(--accent);
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly],
textarea[readonly] {
  background: #eef1f6;
  color: #667085;
  cursor: not-allowed;
}

/* #endregion */

/* #region Utility Text */
.hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.small {
  font-size: 12px;
  color: var(--muted);
}

/* #endregion */

/* #region Buttons */
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn.secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn.danger {
  background: #fee4e2;
  color: var(--danger);
}

.btn.good {
  background: #dcfae6;
  color: var(--good);
}
/* #endregion */

/* #region Repeat Sections */
.repeat-box {
  grid-column: 1/-1;
  border: 1px dashed #aab4c5;
  border-radius: 12px;
  padding: 14px;
  background: #fcfdff;
}

.repeat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.repeat-head h3 {
  margin: 0;
  font-size: 16px;
}

.repeat-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
  background: #fff;
}

.repeat-item-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  color: #344054;
  font-weight: 700;
}
/* #endregion */

/* #region Checkbox Rows */
.checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: #344054;
}

.checkbox-row.compact {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.id-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.disabled-field {
  background: #eef1f6;
  color: #667085;
  cursor: not-allowed;
  opacity: 0.9;
}

label {
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.is-hidden {
  display: none !important;

  opacity: 0;

  transform: translateY(-4px);

  pointer-events: none;
}

.checkbox-row input {
  width: auto;
}
/* #endregion */

/* #region Review Section */
.review-grid {
  padding: 18px 20px;
  display: grid;
  gap: 10px;
}

.review-row {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 12px;
  border-bottom: 1px solid #eef1f6;
  padding: 8px 0;
  font-size: 13px;
}

.review-key {
  font-weight: 700;
  color: #344054;
}

.review-val {
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}
/* #endregion */

/* #region Progress */
.progress-wrap {
  width: 100%;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
/* #endregion */

/* #region Validation */
.invalid {
  border-color: var(--danger) !important;
}

.form-error-banner {
  display: none;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 14px;
  font-weight: 600;
}

.form-error-banner.show {
  display: block;
}
/* #endregion */

/* #region Backup Actions */
.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
/* #endregion */
.fields.triple {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr 1.7fr;
  gap: 1.25rem;
}

.describe-grid {
  display: grid;

  grid-template-columns:
    160px
    1fr
    1.6fr;

  gap: 1.5rem;
}
/* #region Responsive */
@media (max-width: 850px) {
  header {
    position: static;
  }

  .top-bar {
    padding: 12px 16px 0;
  }

  .layout {
    display: block;
    min-height: auto;
  }

  aside {
    position: static;
    height: auto;
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  main {
    max-width: none;
    padding: 16px;
  }

  .fields,
  .fields.triple,
  .describe-grid,
  .review-row {
    grid-template-columns: 1fr;
  }

  .tools,
  .form-navigation,
  .repeat-head,
  .repeat-item-title {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
/* #endregion */
