/* ============================================================
   Horizontal theme  (captcha_keypad_theme = horizontal)
   ============================================================
   Layout uses a 2-column CSS grid on .fieldset-wrapper:

     COL 1 (rows 1–2): large CODE label + input + clear button
     COL 2 ROW 1:      5-column button grid
     COL 2 ROW 2:      click/tap sequence instruction

   The fieldset legend is visually hidden; the large label
   text serves as the section title.
   ============================================================ */

/* Outer fieldset */
.captcha-keypad-theme--horizontal {
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem 0.875rem;
  background: #f8fafc;
  display: inline-block;
}

.captcha-keypad-theme--horizontal.captcha-keypad-has-error {
  border-color: #ef4444;
  border-width: 2px;
}

/* Hide fieldset legend — the large label acts as the title */
.captcha-keypad-theme--horizontal > legend {
  display: none;
}

/* 2-column grid on the inner wrapper */
.captcha-keypad-theme--horizontal .fieldset-wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.4rem 1.5rem;
  align-items: start;
}

/* Cancel float-based plain-theme rules */
.captcha-keypad-theme--horizontal .form-item,
.captcha-keypad-theme--horizontal .captcha-keypad {
  float: none;
  margin: 0;
  min-height: unset;
}

/* ── COL 1: label + input + clear, spans both rows ── */
.captcha-keypad-theme--horizontal .form-item-captcha-response {
  grid-column: 1;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

/* Large "CODE" label acts as the prominent "ENTER CODE" heading */
.captcha-keypad-theme--horizontal .form-item-captcha-response label {
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
  margin: 0;
  line-height: 1.1;
}

/* Input field */
.captcha-keypad-theme--horizontal #edit-captcha-response {
  width: 5.5rem;
  max-width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  background: #fff;
}

/* Clear button: compact pill */
.captcha-keypad-theme--horizontal .clear {
  display: inline-block;
  align-self: flex-start;
  width: auto;
  height: auto;
  padding: 0.15rem 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font-size: 0.7rem;
  cursor: pointer;
  background: #fff;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}
.captcha-keypad-theme--horizontal .clear:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* ── COL 2, ROW 1: 5-column button grid ── */
.captcha-keypad-theme--horizontal .captcha-keypad {
  grid-column: 2;
  grid-row: 1;
}

.captcha-keypad-theme--horizontal .captcha-keypad .inner {
  display: grid;
  grid-template-columns: repeat(5, 2.25rem);
  gap: 0.3rem;
  border: none;
  height: auto;
  width: auto;
}

.captcha-keypad-theme--horizontal .captcha-keypad .inner .ck-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: #374151;
  transition: background 100ms ease, border-color 100ms ease;
  margin: 0;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.captcha-keypad-theme--horizontal .captcha-keypad .inner .ck-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.captcha-keypad-theme--horizontal .captcha-keypad .inner .ck-btn:active {
  background: #e5e7eb;
  transform: translateY(1px);
}

/* ── COL 2, ROW 2: sequence instruction ── */
.captcha-keypad-theme--horizontal .sequence {
  grid-column: 2;
  grid-row: 2;
  float: none;
  font-size: 0.8rem;
  color: #6b7280;
  padding: 0;
  margin-top: 0;
  align-self: start;
}

/* ── COL 2, ROW 3: use keypad message ── */
.captcha-keypad-theme--horizontal .message {
  grid-column: 2;
  font-size: 0.8rem;
  color: #ef4444;
  margin-top: 0.15rem;
}
