/* Eterano v0.6.1 — Step 3 layout fixes + light/dark theme */

/* Choice controls must never inherit the global 100% input width. */
input[type="checkbox"],
input[type="radio"]{
  width:18px!important;
  height:18px;
  min-width:18px;
  max-width:18px;
  padding:0;
  margin:0;
  accent-color:#1479f8;
}

.settings-grid,.settings-column,.availability-panel,.availability-controls,
.availability-number-grid,.availability-options-row,.fulfillment-fieldset,
.fulfillment-settings,.public-grid,.public-form,.public-step3-block,
.public-choice-fieldset,.public-choice-grid,.industry-fields,
.two-columns,.three-columns,.unit-field{min-width:0}

input,select,textarea{min-width:0}

.choice-card,.public-choice-card{
  display:grid;
  grid-template-columns:20px minmax(0,1fr);
  align-items:center;
  gap:11px;
  width:100%;
  min-width:0;
  min-height:62px;
  margin:0;
  padding:14px 15px;
  line-height:1.35;
}
.choice-card>span,.public-choice-card>span{
  display:block;
  min-width:0;
  width:auto;
  white-space:normal;
  word-break:normal;
  overflow-wrap:anywhere;
}
.choice-card input,.public-choice-card input{align-self:center}
.fulfillment-settings,.public-choice-grid{align-items:stretch}
.fulfillment-fieldset legend,.public-choice-fieldset legend{line-height:1.35}

.availability-save-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}
.availability-save-row .primary{margin-left:auto}

/* Theme controls */
.theme-toggle{
  position:relative;
  flex:0 0 auto;
  color:#17325c;
  background:rgba(255,255,255,.76);
  border-color:#d7e4f3;
}
.theme-toggle:hover{background:#eef6ff;border-color:#b9d8f7}
.theme-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-icon-sun,.theme-toggle .theme-icon-moon{display:none}
html[data-theme="dark"] .theme-toggle .theme-icon-sun{display:block}
html[data-theme="light"] .theme-toggle .theme-icon-moon{display:block}

.theme-settings-card{display:grid;gap:14px}
.theme-segmented{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:15px;
  background:#edf4fc;
}
.theme-option{
  min-height:42px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-weight:800;
  padding:8px 10px;
}
.theme-option[aria-pressed="true"]{
  background:#fff;
  color:#0757d8;
  box-shadow:0 5px 16px rgba(16,56,112,.12);
}
.theme-settings-card .muted{margin:0}

/* Dark palette and native form controls */
html[data-theme="dark"]{
  color-scheme:dark;
  --ink:#eaf1ff;
  --ink-2:#c5d3e8;
  --cream:#071126;
  --paper:#0d1a31;
  --line:#263a57;
  --muted:#91a4c0;
  --accent:#42a9ff;
  --accent-soft:#17304c;
  --success:#42c69b;
  --danger:#ff8493;
  --warning:#f0bd67;
  --shadow:0 18px 52px rgba(0,0,0,.30);
}
html[data-theme="dark"],html[data-theme="dark"] body{background:#071126;color:#eaf1ff}
html[data-theme="dark"] body{background:radial-gradient(circle at 80% -10%,rgba(23,111,229,.13),transparent 36rem),#071126}
html[data-theme="dark"] .app-main{background:transparent}
html[data-theme="dark"] .content{color:#eaf1ff}
html[data-theme="dark"] .desktop-header,
html[data-theme="dark"] .mobile-header{
  background:rgba(7,17,38,.88);
  border-color:#253752;
  box-shadow:0 7px 24px rgba(0,0,0,.18);
}
html[data-theme="dark"] .desktop-header h1,
html[data-theme="dark"] .mobile-header .brand-word{color:#eef5ff}
html[data-theme="dark"] .language-btn,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .theme-toggle{
  color:#dce9ff;
  background:rgba(15,31,57,.88);
  border-color:#324968;
}
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .language-btn:hover{background:#172c49;border-color:#466587}

html[data-theme="dark"] :where(.panel,.stat-card,.order-card,.receipt-card,.customer-card,.product-card,.modal,.order-detail-section,.public-form,.public-info-card,.public-product,.confirmation-summary,.confirmation-next,.date-suggestion,.weekly-row,.closed-date-row,.choice-card,.public-choice-card,.mobile-agenda-item,.public-image-preview){
  background:#0d1a31;
  color:#eaf1ff;
  border-color:#273c59;
}
html[data-theme="dark"] :where(input,textarea,select,.slug-field,.search-field){
  color:#eaf1ff;
  background:#0a162a;
  border-color:#2b405e;
}
html[data-theme="dark"] :where(input,textarea,select)::placeholder{color:#7287a6}
html[data-theme="dark"] select option{background:#0a162a;color:#eaf1ff}
html[data-theme="dark"] .slug-field span{color:#8296b4}
html[data-theme="dark"] .search-field input{background:transparent}
html[data-theme="dark"] .secondary{background:#17304c;color:#dce9ff}
html[data-theme="dark"] .secondary:hover{background:#1c3a5d}
html[data-theme="dark"] .text-button{color:#9dcaff}
html[data-theme="dark"] .text-button.subtle{color:#91a4c0}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .stat-card span,
html[data-theme="dark"] .stat-card small,
html[data-theme="dark"] .customer-card p,
html[data-theme="dark"] .product-card p,
html[data-theme="dark"] .card-main p,
html[data-theme="dark"] .meta-pair span,
html[data-theme="dark"] .amount-block small,
html[data-theme="dark"] .public-product p,
html[data-theme="dark"] .public-bullets li,
html[data-theme="dark"] .public-long-text{color:#91a4c0}
html[data-theme="dark"] .stat-card strong,
html[data-theme="dark"] .product-card .price,
html[data-theme="dark"] .mobile-agenda-amount,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .calendar-toolbar h2{color:#eef5ff}
html[data-theme="dark"] .order-row{background:#101f38;border-color:#263b58;color:#eaf1ff}
html[data-theme="dark"] .date-chip{background:#11233f;border-color:#304867;color:#75b8ff}
html[data-theme="dark"] .workload-track{background:#1a2b44}
html[data-theme="dark"] .calendar-grid{border-color:#2b405d}
html[data-theme="dark"] .calendar-day{background:#0d1a31;border-color:#233751}
html[data-theme="dark"] .calendar-day.outside{background:#09152a;color:#667c9b}
html[data-theme="dark"] .calendar-weekdays{color:#91a4c0}
html[data-theme="dark"] .calendar-toolbar{background:rgba(7,17,38,.94)}
html[data-theme="dark"] #view-calendar{background:linear-gradient(180deg,#071126,#09172c 55%,#071126)}
html[data-theme="dark"] .mobile-calendar-month{background:#0d1a31;border-color:#263b58}
html[data-theme="dark"] .mobile-month-cell{color:#d8e6fb}
html[data-theme="dark"] .mobile-month-cell.outside{color:#536782}
html[data-theme="dark"] .mobile-month-cell.has-orders{background:#112746}
html[data-theme="dark"] .mobile-month-cell.today{box-shadow:inset 0 0 0 2px #2a9cff}
html[data-theme="dark"] .mobile-agenda-date{background:#122846;color:#83c3ff}

html[data-theme="dark"] .logo-upload-card,
html[data-theme="dark"] .cover-upload-card,
html[data-theme="dark"] .availability-master,
html[data-theme="dark"] .availability-hint,
html[data-theme="dark"] .invite-code,
html[data-theme="dark"] .inspiration-link-fallback,
html[data-theme="dark"] .file-upload-field input[type=file],
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .demo-notice{
  background:#101f38;
  color:#dbe8fb;
  border-color:#2b405d;
}
html[data-theme="dark"] .availability-controls.is-disabled{opacity:.48}
html[data-theme="dark"] .weekly-schedule{border-color:#2b405d}
html[data-theme="dark"] .weekly-row{border-bottom-color:#263a56}
html[data-theme="dark"] .profile-cover-preview{border:1px solid #334c6d}
html[data-theme="dark"] .theme-segmented{background:#09162a;border-color:#2b405d}
html[data-theme="dark"] .theme-option{color:#91a4c0}
html[data-theme="dark"] .theme-option[aria-pressed="true"]{background:#17304c;color:#7ec4ff;box-shadow:none}

html[data-theme="dark"] .modal::backdrop{background:rgba(0,4,14,.76)}
html[data-theme="dark"] .dialog-close{background:#172b47;color:#dce9ff}
html[data-theme="dark"] .order-reference{background:#112744;color:#91c9ff}
html[data-theme="dark"] .order-inspiration-preview{border-color:#2b405d}
html[data-theme="dark"] .status-confirmed{background:#123d36;color:#79e1be}
html[data-theme="dark"] .status-requested{background:#483615;color:#ffd18b}
html[data-theme="dark"] .status-in_production{background:#30264f;color:#c3a8ff}
html[data-theme="dark"] .status-ready{background:#123850;color:#83d3ff}
html[data-theme="dark"] .status-completed{background:#273248;color:#b4c3db}
html[data-theme="dark"] .status-cancelled{background:#4a202a;color:#ff9cab}

/* Customer-facing page dark mode */
html[data-theme="dark"] .public-page{
  background:radial-gradient(circle at 100% 0,rgba(21,199,246,.10),transparent 28rem),linear-gradient(180deg,#071126,#09172c 52%,#071126);
}
html[data-theme="dark"] .public-header{background:rgba(7,17,38,.90);border-color:#243854;box-shadow:0 6px 22px rgba(0,0,0,.18)}
html[data-theme="dark"] .public-header .brand-word{color:#eef5ff}
html[data-theme="dark"] .public-product strong,
html[data-theme="dark"] .public-total strong{color:color-mix(in srgb,var(--business-accent) 72%,#8fd9ff)}
html[data-theme="dark"] .qty-btn{background:#132944;border-color:#315070;color:#8ecbff}
html[data-theme="dark"] .qty-btn:hover{background:#183656}
html[data-theme="dark"] .availability-hint.error-text{background:#431e2a;color:#ff9cad}
html[data-theme="dark"] .date-suggestion:hover{background:#142945}
html[data-theme="dark"] .confirmation-reference{background:#102743;border-color:#284c70}
html[data-theme="dark"] .confirmation-reference strong{color:#77c4ff}
html[data-theme="dark"] .form-message{background:#123a32;color:#77ddb8;border-color:#245a4d}
html[data-theme="dark"] .public-footer{color:#7f94b2}
html[data-theme="dark"] .public-footer .brand-word{color:#a8ceff}

/* Authentication screen */
html[data-theme="dark"] .auth-page{background:linear-gradient(108deg,#03102f 0 51%,#071126 51% 100%)}
html[data-theme="dark"] .auth-card{background:#0d1a31;border-color:#293e5b;color:#eaf1ff}
html[data-theme="dark"] .auth-card h2{color:#eef5ff}

/* Browser autofill */
html[data-theme="dark"] input:-webkit-autofill,
html[data-theme="dark"] input:-webkit-autofill:hover,
html[data-theme="dark"] input:-webkit-autofill:focus{
  -webkit-text-fill-color:#eaf1ff;
  -webkit-box-shadow:0 0 0 1000px #0a162a inset;
  transition:background-color 9999s ease-out 0s;
}

@media(max-width:1100px){
  .fulfillment-settings{grid-template-columns:repeat(2,minmax(180px,1fr))}
}
@media(max-width:760px){
  .theme-toggle{width:42px;min-height:42px;padding:0}
  .theme-segmented{grid-template-columns:1fr}
  .availability-save-row{align-items:stretch}
  .availability-save-row .primary{width:100%;margin-left:0}
  .fulfillment-settings{grid-template-columns:1fr 1fr}
  .choice-card,.public-choice-card{min-height:58px}
  html[data-theme="dark"] .mobile-backdrop{background:rgba(0,5,17,.65)}
}
@media(max-width:520px){
  .fulfillment-settings{grid-template-columns:1fr}
  .choice-card,.public-choice-card{grid-template-columns:20px minmax(0,1fr)}
}

.public-header-actions,.mobile-header-actions,.auth-compact-actions{display:flex;align-items:center;gap:8px}.onboarding-theme-row{display:flex;justify-content:flex-end;margin-bottom:8px}
html[data-theme="dark"] .choice-card:has(input:checked),
html[data-theme="dark"] .public-choice-card:has(input:checked){
  background:#173653;
  color:#eef6ff;
  border-color:#4aa7ff;
  box-shadow:0 0 0 3px rgba(74,167,255,.12);
}
html[data-theme="dark"] .choice-card:has(input:checked)>span,
html[data-theme="dark"] .public-choice-card:has(input:checked)>span{color:#eef6ff}
html[data-theme="dark"] .availability-controls.is-disabled{opacity:.66}
html[data-theme="dark"] input[type=file]::file-selector-button{
  color:#dce9ff;
  background:#17304c;
  border:1px solid #365475;
  border-radius:8px;
  padding:7px 10px;
  margin-right:10px;
}
