/* ============================================================
   Vertical theme  (captcha_keypad_theme = vertical)
   ============================================================
   Layout: centred flex column.

     ROW 1: CODE label + input + clear button (centred)
     ROW 2: 3×3 button grid (centred)
     ROW 3: click/tap sequence instruction (centred)
   ============================================================ */

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

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

/* Centred column layout */
.captcha-keypad-theme--vertical .fieldset-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

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

/* ── ROW 1: label + input + clear, centred ── */
.captcha-keypad-theme--vertical .form-item-captcha-response {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
}

.captcha-keypad-theme--vertical .form-item-captcha-response label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #6b7280;
  margin: 0;
}

.captcha-keypad-theme--vertical #edit-captcha-response {
  width: 7rem;
  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.2em;
  text-align: center;
  background: #fff;
}

/* Clear button */
.captcha-keypad-theme--vertical .clear {
  display: inline-block;
  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--vertical .clear:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* ── ROW 2: 3-column button grid (3+3+3+1 with 10 keys) ── */
.captcha-keypad-theme--vertical .captcha-keypad {
  flex: 0 0 auto;
}

.captcha-keypad-theme--vertical .captcha-keypad .inner {
  display: grid;
  grid-template-columns: repeat(3, 2.5rem);
  gap: 0.35rem;
  border: none;
  height: auto;
  width: auto;
}

.captcha-keypad-theme--vertical .captcha-keypad .inner .ck-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  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--vertical .captcha-keypad .inner .ck-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.captcha-keypad-theme--vertical .captcha-keypad .inner .ck-btn:active {
  background: #e5e7eb;
  transform: translateY(1px);
}

/* Centre the lone 10th button (0) in the bottom row */
.captcha-keypad-theme--vertical .captcha-keypad .inner .ck-btn:last-child:nth-child(3n + 1) {
  grid-column: 2;
}

/* ── ROW 3: sequence instruction ── */
.captcha-keypad-theme--vertical .sequence {
  float: none;
  font-size: 0.8rem;
  color: #6b7280;
  padding: 0;
  margin-top: 0.1rem;
  text-align: center;
}

/* ── ROW 4: use keypad message ── */
.captcha-keypad-theme--vertical .message {
  font-size: 0.75rem;
  color: #ef4444;
  text-align: center;
  margin-top: 0.1rem;
}
