/* Embed signup page styles — neutral, framework-free, tokens from 04-UI-SPEC.md */

body {
  margin: 0;
  background: #FFFFFF;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1F2933;
  padding: 16px;
}

.form-container {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  background: #F5F6F8;
  border-radius: 8px;
  padding: 16px;
}

h1 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 32px;
}

.holder-type-toggle {
  display: flex;
  width: 100%;
  border: 1px solid #5B6472;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.holder-type-option {
  flex: 1 1 50%;
  min-height: 44px;
  margin: 0;
  padding: 8px 4px;
  border: none;
  border-radius: 0;
  background: #FFFFFF;
  color: #1F2933;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.holder-type-option + .holder-type-option {
  border-left: 1px solid #5B6472;
}

.holder-type-option:hover:not([aria-checked="true"]) {
  background: #E8EAEE;
}

.holder-type-option[aria-checked="true"] {
  background: #2563EB;
  color: #FFFFFF;
}

.holder-type-option:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
  z-index: 1;
}

.ean-selection-error:not([hidden]) {
  color: #DC2626;
  margin: 0 0 8px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

input,
button {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  font-family: inherit;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
}

.form-row .form-field {
  flex: 1 1 auto;
  min-width: 0;
}

.form-row .form-field-postcode {
  flex: 1.4 1 130px;
}

.form-row .form-field-house-number {
  flex: 0.8 1 80px;
}

.form-row .form-field-suffix {
  flex: 1 1 100px;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #5B6472;
  border-radius: 4px;
  background: #FFFFFF;
  color: #1F2933;
}

input:focus-visible,
button:focus-visible {
  outline: 2px solid #2563EB;
}

input.invalid {
  border-color: #DC2626;
}

.caption,
.form-field-consent label,
.ean-result-secondary,
.ean-lookup-helper {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #5B6472;
}

#btn-submit {
  background: #2563EB;
  color: #FFFFFF;
  min-height: 44px;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
}

#btn-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

#btn-manual-ean-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #2563EB;
  border: none;
  min-height: 44px;
  padding: 8px 0;
  margin-right: 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.manual-ean-toggle-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor; /* ▼ collapsed */
  transition: transform 0.15s ease;
}

#btn-manual-ean-toggle[aria-expanded="true"] .manual-ean-toggle-caret {
  transform: rotate(180deg); /* ▲ expanded */
}

.ean-manual-fields {
  margin-top: 8px;
}

.ean-manual-fields.hidden {
  display: none;
}

.form-field-street {
  flex: 2 1 0;
  min-width: 0;
}

.form-field-city {
  flex: 1 1 0;
  min-width: 0;
}

.form-field-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.form-field-consent label {
  min-height: 44px;
  padding: 0 0 8px;
  /* block + top-aligned checkbox — do not center against multi-line copy */
  display: block;
  line-height: 1.4;
}

#consent {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px; /* optical align with first line (matches .ean-result-checkbox) */
  accent-color: #2563EB;
}

.ean-result-card {
  background: #F5F6F8;
  min-height: 44px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.ean-result-card.selected {
  border: 2px solid #2563EB;
  background: #EFF6FF;
}

.ean-result-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid #5B6472;
  border-radius: 4px;
  background: #FFFFFF;
}

.ean-result-card.selected .ean-result-checkbox {
  background: #2563EB;
  border-color: #2563EB;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3 8.5L6.2 11.5L13 4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.ean-result-text {
  min-width: 0;
}

.ean-lookup-helper.hidden {
  display: none;
}

.hidden {
  display: none;
}

.banner {
  padding: 16px;
  border-radius: 4px;
  margin-top: 16px;
}

.banner[hidden] {
  display: none;
}

.banner-success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #16A34A;
}

.banner-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #DC2626;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 600px) {
  body {
    padding: 24px;
  }

  .form-container {
    padding: 24px;
  }
}
