:root{
  --bg-left: #0b0b0b;
  --text-left: #ffffff;
  --muted-left: rgba(255,255,255,.65);

  --bg-right: #ffffff;
  --text: #111;
  --muted: #6b7280;

  --border: #d1d5db;
  --focus: #1f6feb;

  --danger: #dc2626;
  --btn: #ff4d00;

  --pad-y: 64px;
  --pad-x: 56px;

  --pad-y-mobile: 28px;
  --pad-x-mobile: 18px;
}

*{ box-sizing:border-box; }

html, body{
  height:100%;
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-right);
}

/* Hard guard against mobile horizontal overflow */
body{
  overflow-x: hidden;
}

.layout{
  min-height:100vh;
  width: 100%;
  display:flex;
  overflow-x: hidden;
}

/* LEFT (black) */
.left{
  width: 38%;
  min-width: 360px;
  background: var(--bg-left);
  color: var(--text-left);
  padding: var(--pad-y) var(--pad-x);
  display:flex;
  flex-direction:column;
  overflow-x: hidden;
}

.brand-logo{
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: .5px;
}

.brand-tagline{
  margin-top: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-sub{
  margin-top: 6px;
  color: var(--muted-left);
  font-size: 13px;
}

.left-section{
  margin-top: 56px;
}

.left-kicker{
  font-weight: 700;
  margin-bottom: 10px;
}

.left-lead{
  margin: 0 0 16px;
  color: var(--muted-left);
  max-width: 46ch;
  line-height: 1.45;
}

.left-list{
  margin: 0;
  padding-left: 18px;
  color: var(--text-left);
}

.left-list li{
  margin: 10px 0;
}

.left-footer{
  margin-top:auto;
  color: var(--muted-left);
  font-size: 12px;
}

.left-footer code{
  color: var(--text-left);
}

/* RIGHT (white) */
.right{
  flex:1;
  padding: var(--pad-y) var(--pad-x);
  background: var(--bg-right);
  overflow-x: hidden;
}

.form-wrap{
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

.h1{
  font-size: 56px;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}

.field{
  margin-top: 14px;
}

label{
  display:block;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
}

/* Critical: ensure inputs never exceed container width on mobile Safari */
input{
  max-width: 100%;
  min-width: 0;
  display:block;
}

input[type="date"],
input[type="number"]{
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  outline: none;
  font-size: 14px;
  background: #fff;
}

input:focus{
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(31,111,235,.15);
}

input.has-error{
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(220,38,38,.12);
}

.error{
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
  display:none;
}

.error.show{
  display:block;
}

.row{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 18px;
}

.checkbox{
  display:flex;
  gap: 10px;
  align-items:center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.btn{
  background: var(--btn);
  border: none;
  color: #111;
  font-weight: 700;
  padding: 12px 22px;
  min-width: 140px;
  border-radius: 2px;
  cursor: pointer;
}

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

.status{
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.divider{
  margin: 22px 0;
  height: 1px;
  background: #e5e7eb;
}

.accordion{
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 0;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display:flex;
  justify-content: space-between;
  align-items:center;
}

.panel{
  display:none;
  border-top: 1px solid #e5e7eb;
}

.panel.open{
  display:block;
}

.panel-inner{
  padding: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* MOBILE / TABLET */
@media (max-width: 1100px){
  .layout{
    flex-direction: column;
  }

  /* Make black + white padding match exactly on mobile */
  .left,
  .right{
    padding:
      calc(var(--pad-y-mobile) + env(safe-area-inset-top))
      calc(var(--pad-x-mobile) + env(safe-area-inset-right))
      var(--pad-y-mobile)
      calc(var(--pad-x-mobile) + env(safe-area-inset-left));
  }

  .left{
    width:100%;
    min-width:0; /* important */
  }

  .right{
    width:100%;
  }

  .h1{
    font-size: 40px;
  }

  .left-section{
    margin-top: 28px;
  }

  /* Prevent overflow from checkbox + button row */
  .row{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn{
    width: 100%;
    min-width: 0;
  }

  .checkbox{
    width: 100%;
  }

  /* iOS/Safari date control sizing quirks */
  input[type="date"]{
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
  }
  input[type="date"]::-webkit-date-and-time-value{
    text-align: left;
  }
}

/* Small phones */
@media (max-width: 420px){
  .brand-logo{ font-size: 46px; }
  .h1{ font-size: 34px; }
}
