/* === Layout primitives (home layout) === */
:root {
  --container-max: 1360px;   /* overall max width for header + content + footer */
  --content-max: 800px;      /* central content column (wizard max width) */
  --sidebar-width: 240px;    /* fixed width for each sidebar */
  --gutter: 16px;
  /* Colours, radius, brand, etc. now come from tokens.css */
}

/* === Form system: labels, fields, rows === */

.form {
  display: grid;
  gap: 16px;
}

/* Single field wrapper */
.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font: 13px/1.4 var(--font);
  color: var(--muted);
}

/* text under field: help or error */
.field__help {
  font: 12px/1.4 var(--font);
  color: var(--muted);
}

.field-row {
  display: grid;
  gap: 12px;
}

/* On wider screens, split evenly 50/50 */
@media (min-width: 640px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }
}


/* base control styles – shared for input/select/textarea */
.control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  font: 14px/1.4 var(--font);
  color: var(--ink);
}

/* make them the same height */
.control--lg {
  height: 44px;
}

/* remove duplicated per-element styling later */
.control:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-weak);
}


html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.5 var(--font);
}

/* Full-height layout so footer always sticks to the bottom */
html,
body {
  height: 100%;
}


body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main grows to fill the space between header and footer */
main.container {
  flex: 1 0 auto;
}



a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px var(--gutter);   /* consistent horizontal gutters for all content */
}



.header { background: var(--panel); border-bottom: 1px solid var(--border); }

.header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--gutter);
  max-width: var(--content-max);
  margin: 0 auto;
}

.header .nav a { margin-left: 12px; }


.footer { margin-top: 24px; border-top: 1px solid var(--border); background: var(--panel); }


.footer .inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px var(--gutter);
  color: var(--muted);
}


/* Two-column footer layout (collapses to one column on mobile) */
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
}

.footer-col {
  flex: 1 1 240px;
}

.footer-heading {
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-meta {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.footer-col-right {
  text-align: right;
}

@media (max-width: 640px) {
  .footer-col-right {
    text-align: left;
  }
}


.footer-links li + li {
  margin-top: 4px;
}

@media (max-width: 640px) {
  .footer-grid {
    flex-direction: column;   /* stack the two columns */
    align-items: flex-start;  /* align them to the left */
    gap: 8px;                 /* small gap between the two lists */
  }

  .footer-col {
    flex: 0 0 auto;           /* stop columns from stretching vertically */
  }
}



.grid {
  display:grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--content-max)) minmax(0, 1fr);
  gap: 24px;
}

/* When sidebars are enabled, keep the middle column the same width
   and give fixed widths to the sidebars. */
.has-left-only  .grid {
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-max)) minmax(0, 1fr);
}

.has-right-only .grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--content-max)) var(--sidebar-width);
}

.has-both       .grid {
  grid-template-columns: var(--sidebar-width) minmax(0, var(--content-max)) var(--sidebar-width);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* NEW – consistent gap below panel headings (Step 2 & 3) */
.panel-head {
  margin-bottom: 16px;
}


.sidebar { position: sticky; top: 16px; height: fit-content; }
.sidebar .placeholder { border:1px dashed var(--border); border-radius: var(--radius); padding:12px; color:var(--muted); font-size:14px; }

h1, h2, h3 { line-height:1.2; margin: 0 0 10px; }
h1 { font-size: 28px; }
h2 { font-size: 20px; color: var(--muted); }

/* Buttons / inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;

  font: 14px/1.4 var(--font);
  font-weight: 500;
  cursor: pointer;

  background: var(--brand);
  color: #fff;
}



.btn:disabled { opacity:.6; cursor:not-allowed; }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--border); }


button.btn {
  font: inherit;
  font-weight:500;
}


.btn.danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}

/* Base styling for any plain input/select/textarea
   that is NOT already using .control */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  font: 14px/1.4 var(--font);
  color: var(--ink);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px 12px;
}



.help { color: var(--muted); font-size: 13px; }


/* Simple forms */
.form .row { display:flex; gap:12px; }
.form .row > * { flex:1; }

/* Buttons that are direct children of the form (e.g. Step 3 "Proceed") */
.form > .btn,
.form > button.btn {
  justify-self: flex-start;
}

/* On small screens, stack Step-1 fields vertically */
@media (max-width: 640px) {
  .form .row {
    flex-direction: column;
  }
}



/* Tables (for my domains, admin-ish lists) */
.table { width:100%; border-collapse: collapse; }
.table th, .table td { padding:10px 12px; border-top:1px solid var(--border); }
.table th { text-align:left; color:var(--muted); font-weight:600; background:#f9fafb; }

/* Responsive tables – stack rows on small screens */
@media (max-width: 640px) {
  .table {
    border: 0;
  }

  .table thead {
    display: none;
  }

	.table tbody tr {
	  display: block;
	  border: 1px solid var(--border);
	  border-radius: var(--radius);
	  margin-bottom: 12px;
	  overflow: hidden;
	}


  .table tbody td {
    display: block;
    border-top: 0;
    padding: 8px 12px;
  }

  .table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 2px;
  }

  .table tbody td:last-child {
    margin-top: 4px;
  }
}


/* Tenant (subdomain) layout can diverge later */
.tenant-shell .container { max-width: 980px; }

/* Utility */
.mt-16{margin-top:16px} .mt-24{margin-top:24px} .mt-32{margin-top:32px}

/* Remove extra top gap above the first wizard panel on the homepage */
.grid section .panel.mt-16:first-child,
.grid section .panel.mt-16:first-of-type {
  margin-top: 0;
}


/* === Utilities moved out of claim.html (inline → CSS) === */
.list-plain { list-style: none; padding-left: 0; margin: 12px 0; }

/* Step 1 status lists: no extra top margin, so they line up with buttons */
.claim-status .list-plain {
  margin-top: 0;
}

.mt-8  { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }

.hidden { display: none; }
.no-click { pointer-events: none; }
.weak { opacity: .55; }
.underline { text-decoration: underline; }


/* Claim grid: stack on mobile, 2 columns from 640px (same as field-row) */
.claim-grid {
  display: grid;
  grid-template-columns: 1fr;      /* single column by default (<640px) */
  gap: 24px;
}

/* ≥640px: clear 2-column layout, 50/50 split */
@media (min-width: 640px) {
  .claim-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));  /* equal-width columns */
    align-items: flex-start;                           /* top-align rows */
  }

  .claim-grid .claim-status {
    align-self: flex-start;                            /* top-align status text */
  }

  /* NEW: in 2-column layout, remove extra top margin so all 4 items line up */
  .claim-grid .claim-status.mt-4 {
    margin-top: 0;
  }
  
  /* NEW: drop both buttons down slightly to align with status text */
  .claim-grid .claim-actions {
    margin-top: 12px;
  }
}


/* Left column: stack buttons vertically, aligned to the left */
.claim-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;              /* spacing between visible items only */
}

.claim-actions .btn {
  min-width: 0;
}




/* Remove extra list padding/margins on the right; align lines neatly */
.claim-status ul {
  margin: 0;
  padding-left: 0;
}

.claim-status li {
  margin: 6px 0;        /* even spacing between status lines */
  list-style: none;     /* ensure no default bullets leak in */
}

/* Optional: align the first two checks tighter together than 3–5 */
.claim-status ul + ul {
  margin-top: 12px;     /* a small visual gap between the two groups */
}


/* Keep the auth link and language switcher on one line in the homepage header */
.header .bar { display: flex; align-items: center; justify-content: space-between; }
.header .nav { display: flex; align-items: center; gap: 12px; }

/* Keep the language switcher inline without using inline styles */
.lang-form { display: inline-block; margin: 0 0 0 12px; }

/* Language switcher select – compact field styling */
.lang-form select {
  min-width: 72px;
  height: 36px;
  padding: 6px 10px;
}


/* Subtle but visible cue when preview URL changes (used in Step 1 & Step 2) */
@keyframes previewPulse {
  0%   { background-color: rgba(255, 214, 102, 0.00); }
  25%  { background-color: rgba(255, 214, 102, 0.55); }
  100% { background-color: rgba(255, 214, 102, 0.00); }
}

.preview-pulse {
  animation: previewPulse 0.9s ease-out 1;
  border-radius: var(--radius);
}


/* Hide the TLS status text and "Check again" link in Step 1 UI.
   Elements stay in DOM so existing JS gating keeps working. */
#tls-badge,
#check-again {
  display: none;
}


/* 2025-11-26: simplified breakpoints.
   We removed the special layout for 769–1100px so that:
   - <= 768px  → full-width mobile layout (see block below)
   - >  768px  → one consistent centered width, no extra shrink/expand
   around 1100px when resizing the window.

   (Old @media (max-width: 1100px) block was here.)
*/



/* === Small screens: wizard, header, footer use full width (no side gaps) === */
@media (max-width: 768px) {
  /* Main column goes edge-to-edge, small and consistent vertical gap */
  .container {
    max-width: 100%;
    padding-top: 16px;
    padding-bottom: 16px;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
  }

  /* On tenant pages, also allow full width on mobile (override 980px) */
  .tenant-shell .container {
    max-width: 100%;
  }

  /* Header + footer follow the same full width */
  header.header,
  footer.footer {
    padding-left: 0;
    padding-right: 0;
  }

  /* On phones: wizard uses full width, no centered “narrow” column */
  .grid {
    display: block;          /* cancel flex from the 1100px rule */
  }

  .grid > * {
    max-width: 100%;         /* cancel the 800px cap from the 1100px rule */
    width: 100%;
  }

  .sidebar-left,
  .sidebar-right {
    display: none;
  }

  .grid > section {
    margin: 0;
  }

  .panel {
    border-radius: 0;
  }
}


/* === FINAL FIX FOR GAPS (Revised) === */

/* 1. DEFAULT STATE: HIDDEN  */
.help.claim-status {
  display: none !important;
}

/* 2. ACTIVE STATE: VISIBLE */
.help.claim-status:has(li:not(.hidden):not(:empty)) {
  display: block !important;
  /* let the CSS grid decide the column – no spanning */
  margin-top: 0;
}
