/* Kiosk UI */
* {
  box-sizing: border-box;
}

@font-face {
  font-family: "RobotoLocal";
  src: url("./fonts/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "RobotoLocal";
  src: url("./fonts/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --ink: #111111;
  --ink-soft: #464646;
  --line: #1f1f1f;
  --line-soft: #b8b8b8;
  --accent: #1f7a33;
  --toggle-bg: #6a6a6a;
  --toggle-active: #005f21;
  --button-bg: #1f1f1f;
  --button-ink: #ffffff;
  --button-muted-bg: #6a6a6a;
  --button-muted-ink: #ffffff;
  --button-secondary-bg: #ffffff;
  --button-secondary-ink: #1f1f1f;
  --input-bg: #dcdcdc;
  --notice: #0b5e2a;
  --overlay-bg: rgba(255, 255, 255, 0.96);
  --ade-logo-filter: brightness(0) saturate(100%);
  --kiosk-max-width: 720px;
}

body.page-start,
body.page-dni,
body.page-vouchers {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "RobotoLocal", "Segoe UI", sans-serif;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--bg);
}

.brand-fendt {
  --bg: radial-gradient(circle at 30% 0%, #1d6f28 0%, #08310f 60%, #041a09 100%);
  --panel: radial-gradient(circle at 35% -10%, #1e7426 0%, #094213 55%, #06270c 100%);
  --ink: #f4fff2;
  --ink-soft: #d2e5d1;
  --line: #7acb53;
  --line-soft: rgba(143, 207, 109, 0.4);
  --accent: #7acb53;
  --toggle-bg: rgba(176, 187, 175, 0.75);
  --toggle-active: #7acb53;
  --button-bg: #7acb53;
  --button-ink: #083e15;
  --button-muted-bg: #7acb53;
  --button-muted-ink: #083e15;
  --button-secondary-bg: rgba(255, 255, 255, 0.15);
  --button-secondary-ink: #f4fff2;
  --input-bg: #dde4dd;
  --notice: #d5ff9e;
  --overlay-bg: rgba(8, 35, 14, 0.92);
  --ade-logo-filter: brightness(0) invert(1);
}

.brand-valtra {
  --bg: #d9ac00;
  --panel: linear-gradient(180deg, #f2c400 0%, #eebc00 100%);
  --ink: #101010;
  --ink-soft: #222222;
  --line: #0e0e0e;
  --line-soft: rgba(17, 17, 17, 0.45);
  --accent: #101010;
  --toggle-bg: rgba(56, 56, 56, 0.6);
  --toggle-active: #101010;
  --button-bg: #101010;
  --button-ink: #f5f5f5;
  --button-muted-bg: #101010;
  --button-muted-ink: #f5f5f5;
  --button-secondary-bg: #f3cd2f;
  --button-secondary-ink: #101010;
  --input-bg: #ececec;
  --notice: #0e0e0e;
  --overlay-bg: rgba(242, 196, 0, 0.96);
  --ade-logo-filter: brightness(0) saturate(100%);
}

.brand-massey {
  --bg: #dddddd;
  --panel: linear-gradient(180deg, #f6f6f6 0%, #ececec 100%);
  --ink: #191919;
  --ink-soft: #4f4f4f;
  --line: #6b6b6b;
  --line-soft: rgba(107, 107, 107, 0.5);
  --accent: #bb202f;
  --toggle-bg: #7c7c7c;
  --toggle-active: #bb202f;
  --button-bg: #6d6d6d;
  --button-ink: #f6f6f6;
  --button-muted-bg: #6d6d6d;
  --button-muted-ink: #f6f6f6;
  --button-secondary-bg: #f7f7f7;
  --button-secondary-ink: #363636;
  --input-bg: #dedede;
  --notice: #bb202f;
  --overlay-bg: rgba(244, 244, 244, 0.95);
  --ade-logo-filter: brightness(0) saturate(100%);
}

.kiosk-shell {
  width: min(var(--kiosk-max-width), 100vw);
  min-height: 100vh;
  background: var(--panel);
  padding: 30px clamp(20px, 4.5vw, 34px) 28px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}

.kiosk-brand {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin: 6px 0 18px;
  width: 100%;
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-logo-valtra {
  width: clamp(168px, 32vw, 300px);
}

.brand-logo-fendt {
  width: clamp(142px, 26vw, 236px);
}

.brand-logo-fendt-only {
  width: clamp(162px, 28vw, 260px);
}

.brand-logo-valtra-only {
  width: clamp(194px, 34vw, 330px);
}

.brand-logo-massey {
  width: clamp(220px, 40vw, 380px);
}

.kiosk-title {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-size: 1.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.kiosk-center {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 22px;
}

.kiosk-button {
  border: 2px solid var(--button-bg);
  border-radius: 999px;
  min-height: 52px;
  padding: 0 26px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--button-ink);
  background: var(--button-bg);
  cursor: pointer;
}

.kiosk-button.secondary {
  color: var(--button-secondary-ink);
  background: var(--button-secondary-bg);
  border-color: var(--line);
}

.kiosk-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Start */
.start-prompt {
  margin: 0;
  text-transform: uppercase;
  line-height: 1.08;
  letter-spacing: 0.02em;
  font-size: 2.25rem;
  display: grid;
  gap: 4px;
}

.start-prompt .strong {
  font-weight: 700;
}

.page-start .kiosk-shell {
  padding-bottom: 132px;
}

.start-bottom-logo {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(170px, 42vw);
  display: flex;
  justify-content: center;
  align-items: center;
}

.start-bottom-logo img {
  width: 100%;
  height: auto;
  display: block;
  filter: var(--ade-logo-filter);
}

/* DNI */
.page-dni .kiosk-shell {
  justify-content: flex-start;
  padding-top: 46px;
}

.document-panel {
  width: 100%;
  max-width: none;
  margin-top: 22px;
  display: grid;
  justify-items: center;
}

.document-type-toggle {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 12px;
  margin: 0 0 18px;
}

.document-type-btn {
  border: 0;
  border-radius: 999px;
  min-height: 66px;
  background: var(--toggle-bg);
  color: #ffffff;
  text-transform: uppercase;
  font-size: 1.26rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.document-type-btn.is-active {
  background: var(--toggle-active);
}

.document-input {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-height: 118px;
  border: 0;
  border-radius: 60px;
  background: var(--input-bg);
  color: var(--ink);
  text-align: center;
  font-size: 1.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 14px 28px;
}

.document-input.is-passport {
  text-transform: uppercase;
}

.document-input::placeholder {
  color: #8a8a8a;
  letter-spacing: 0.02em;
  font-size: 1.08rem;
}

.document-hint {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  min-height: 20px;
  width: 100%;
  max-width: none;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.dni-actions {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.dni-actions .kiosk-button {
  width: 100%;
  max-width: 420px;
  background: var(--button-muted-bg);
  border-color: var(--button-muted-bg);
  color: var(--button-muted-ink);
  min-height: 60px;
  font-size: 1.2rem;
}

.dni-actions .kiosk-button[disabled] {
  opacity: 0.35;
}

/*
Legacy keypad classes kept for compatibility with previous snapshots.
They are no longer used in the current Android keyboard flow.
*/
.number-pad {
  width: 100%;
  max-width: 248px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.number-key,
.number-gap {
  min-height: 48px;
}

.number-key {
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}

.number-gap {
  visibility: hidden;
}

/* Vouchers */
.welcome-title {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  text-transform: uppercase;
  font-size: 1.55rem;
  letter-spacing: 0.03em;
  text-align: center;
  width: 100%;
}

.welcome-name {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  text-transform: uppercase;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-align: center;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voucher-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  text-transform: uppercase;
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  width: 100%;
  text-align: center;
}

.page-vouchers .kiosk-shell {
  padding-top: 26px;
  padding-bottom: 30px;
  overflow-y: auto;
}

.page-vouchers .kiosk-brand {
  margin-bottom: 30px;
}

.meal-list {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  display: grid;
  gap: 14px;
}

.meal-card {
  border: 2px solid var(--line-soft);
  border-radius: 16px;
  padding: 14px 16px;
  background: #ffffff;
}

.meal-card.selected {
  border-color: var(--line);
}

.meal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meal-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 1.18rem;
}

.meal-status {
  font-size: 0.84rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
  text-align: right;
}

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

.own-label {
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.own-toggle-btn {
  border: 2px solid var(--line);
  border-radius: 999px;
  min-height: 42px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--line);
  cursor: pointer;
}

.own-toggle-btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
}

.own-toggle-btn.is-blocked {
  color: #5d5d5d;
  background: #efefef;
  border-color: #c7c7c7;
}

.own-toggle-btn[disabled] {
  cursor: not-allowed;
}

.own-hint {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.voucher-stepper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.step-btn {
  border: 2px solid var(--line);
  border-radius: 999px;
  min-height: 46px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--line);
  cursor: pointer;
}

.step-btn.secondary {
  color: var(--line);
  background: #ffffff;
}

.step-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.step-value {
  min-width: 42px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.guest-picker {
  margin-top: 12px;
  border-top: 1px solid #dbdbdb;
  padding-top: 12px;
}

.guest-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.guest-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.guest-limit {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.guest-stepper {
  margin-top: 8px;
}

.guest-hint {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.selection-info {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  text-align: center;
}

.notice {
  position: relative;
  z-index: 1;
  min-height: 24px;
  margin-top: 12px;
  text-align: center;
  color: var(--notice);
  font-size: 0.92rem;
  font-weight: 700;
}

.voucher-actions {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  width: 100%;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.voucher-actions .kiosk-button {
  width: 100%;
}

.voucher-actions .kiosk-button:first-child {
  grid-column: 1 / -1;
}

.error-box {
  position: relative;
  z-index: 1;
  background: #fff2f2;
  border: 2px solid #d02b2b;
  color: #a71010;
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  text-align: center;
  font-size: 0.9rem;
}

.flow-screen {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 26px;
  text-align: center;
  background: var(--overlay-bg);
}

.flow-screen h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.2rem;
}

.flow-screen p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.hidden {
  display: none;
}

/* Brand variants */
.brand-fendt .kiosk-shell {
  box-shadow: inset 0 0 0 1px rgba(144, 201, 121, 0.45);
}

.brand-fendt .meal-card {
  background: rgba(5, 28, 11, 0.56);
  border-color: rgba(141, 204, 105, 0.4);
}

.brand-fendt .meal-status,
.brand-fendt .own-hint,
.brand-fendt .selection-info,
.brand-fendt .flow-screen p,
.brand-fendt .voucher-copy,
.brand-fendt .document-hint {
  color: #d8ecd0;
}

.brand-fendt .document-type-btn {
  color: #0f2b11;
}

.brand-fendt .kiosk-button.secondary,
.brand-fendt .step-btn.secondary {
  border-color: rgba(148, 208, 121, 0.8);
}

.brand-valtra .kiosk-shell {
  box-shadow: inset 0 0 0 2px rgba(15, 15, 15, 0.22);
}

.brand-valtra .meal-card {
  background: rgba(255, 232, 136, 0.58);
}

.brand-massey .kiosk-shell {
  box-shadow: inset 0 0 0 1px rgba(87, 87, 87, 0.28);
}

.brand-massey .kiosk-button,
.brand-massey .own-toggle-btn,
.brand-massey .step-btn {
  border-color: #6d6d6d;
}

.brand-massey .own-toggle-btn.is-selected,
.brand-massey .document-type-btn.is-active {
  color: #ffffff;
}

/* Totem 1080x1920 portrait */
@media (orientation: portrait) and (min-width: 1000px) and (min-height: 1700px) {
  .kiosk-shell {
    width: min(100vw, 1080px);
    height: min(100vh, 1920px);
    min-height: unset;
    padding: 88px 76px 70px;
  }

  .kiosk-brand {
    margin: 10px 0 42px;
    gap: 26px;
  }

  .brand-logo-valtra {
    width: 410px;
  }

  .brand-logo-fendt {
    width: 320px;
  }

  .brand-logo-fendt-only {
    width: 360px;
  }

  .brand-logo-valtra-only {
    width: 440px;
  }

  .brand-logo-massey {
    width: 500px;
  }

  .kiosk-title {
    font-size: 3.2rem;
  }

  .start-prompt {
    font-size: 4.7rem;
    gap: 10px;
  }

  .kiosk-button {
    min-height: 98px;
    padding: 0 48px;
    font-size: 1.5rem;
    border-width: 3px;
  }

  .document-type-toggle {
    max-width: 760px;
    margin: 0 0 24px;
    gap: 16px;
  }

  .document-type-btn {
    min-height: 102px;
    font-size: 2.15rem;
  }

  .document-input {
    max-width: 760px;
    min-height: 198px;
    border-radius: 74px;
    font-size: 3.35rem;
    padding: 10px 30px;
  }

  .document-input::placeholder {
    font-size: 2rem;
  }

  .document-hint {
    max-width: 760px;
    min-height: 40px;
    font-size: 1.34rem;
  }

  .dni-actions {
    margin-top: 30px;
    gap: 16px;
  }

  .dni-actions .kiosk-button {
    min-width: 380px;
    min-height: 94px;
    font-size: 2rem;
  }

  .welcome-title {
    font-size: 2.8rem;
  }

  .welcome-name {
    max-width: 100%;
    font-size: 2.1rem;
    margin-bottom: 16px;
  }

  .voucher-copy {
    margin-bottom: 20px;
    font-size: 1.7rem;
  }

  .meal-list {
    max-width: 760px;
    gap: 16px;
  }

  .meal-card {
    border-width: 3px;
    border-radius: 20px;
    padding: 18px 24px;
  }

  .meal-name {
    font-size: 1.9rem;
  }

  .meal-status {
    font-size: 1.12rem;
  }

  .own-row {
    margin-top: 14px;
  }

  .own-label {
    font-size: 1.28rem;
  }

  .own-toggle-btn {
    min-height: 70px;
    padding: 0 26px;
    font-size: 1.05rem;
    border-width: 3px;
  }

  .own-hint {
    margin-top: 10px;
    font-size: 1.06rem;
  }

  .guest-picker {
    margin-top: 16px;
    padding-top: 14px;
  }

  .guest-title {
    font-size: 1.34rem;
  }

  .guest-limit {
    font-size: 1.24rem;
  }

  .voucher-stepper {
    grid-template-columns: 170px auto 170px;
    gap: 20px;
    margin-top: 14px;
  }

  .step-btn {
    min-height: 82px;
    font-size: 2.1rem;
    border-width: 3px;
  }

  .step-value {
    min-width: 90px;
    font-size: 2rem;
  }

  .guest-hint {
    margin-top: 12px;
    font-size: 1.06rem;
  }

  .selection-info {
    margin-top: 14px;
    font-size: 1.24rem;
  }

  .notice {
    margin-top: 14px;
    font-size: 1.2rem;
    min-height: 36px;
  }

  .voucher-actions {
    margin-top: 20px;
    gap: 14px;
  }

  .flow-screen h2 {
    font-size: 2.6rem;
  }

  .flow-screen p {
    font-size: 1.5rem;
  }
}

/* Totem 720x1280 portrait */
@media (orientation: portrait) and (min-width: 680px) and (max-width: 860px) and (min-height: 1100px) {
  .kiosk-shell {
    padding: 38px 34px 34px;
  }

  .kiosk-brand {
    margin: 8px 0 24px;
    gap: 18px;
  }

  .page-vouchers .kiosk-brand {
    margin-bottom: 36px;
  }

  .brand-logo-valtra {
    width: 312px;
  }

  .brand-logo-fendt {
    width: 238px;
  }

  .brand-logo-fendt-only {
    width: 280px;
  }

  .brand-logo-valtra-only {
    width: 336px;
  }

  .brand-logo-massey {
    width: 360px;
  }

  .start-prompt {
    font-size: 3.1rem;
    gap: 8px;
  }

  .kiosk-button {
    min-height: 62px;
    font-size: 1.2rem;
  }

  .document-type-btn {
    min-height: 82px;
    font-size: 1.58rem;
  }

  .document-input {
    min-height: 134px;
    font-size: 2rem;
    border-radius: 58px;
  }

  .document-hint {
    font-size: 1rem;
  }

  .dni-actions .kiosk-button {
    max-width: 500px;
    min-height: 70px;
    font-size: 1.42rem;
  }

  .welcome-title {
    font-size: 1.95rem;
    margin-bottom: 20px;
  }

  .welcome-name {
    font-size: 1.48rem;
    margin-bottom: 20px;
  }

  .voucher-copy {
    margin-bottom: 26px;
    font-size: 1.16rem;
  }

  .meal-list {
    gap: 16px;
  }

  .meal-card {
    padding: 18px 20px;
    border-radius: 18px;
  }

  .meal-name {
    font-size: 1.34rem;
  }

  .meal-status {
    font-size: 0.95rem;
  }

  .own-label {
    font-size: 1.08rem;
  }

  .own-toggle-btn {
    min-height: 48px;
    font-size: 0.9rem;
    padding: 0 18px;
  }

  .own-hint {
    font-size: 0.95rem;
  }

  .guest-title {
    font-size: 1.1rem;
  }

  .guest-limit {
    font-size: 1rem;
  }

  .voucher-stepper {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 18px;
    margin-top: 12px;
  }

  .step-btn {
    min-height: 56px;
    font-size: 1.45rem;
  }

  .step-value {
    font-size: 1.42rem;
    min-width: 60px;
  }

  .guest-hint {
    font-size: 0.95rem;
  }

  .selection-info {
    font-size: 1.05rem;
  }

  .notice {
    font-size: 1rem;
  }
}

/* Ticket screen */
@page {
  size: 80mm auto;
  margin: 0;
}

body.page-ticket {
  margin: 0;
  font-family: "Courier New", monospace;
  width: 80mm;
  color: #111;
}

body.page-ticket .ticket {
  padding: 8mm 6mm;
}

body.page-ticket .center {
  text-align: center;
}

body.page-ticket h1 {
  margin: 0;
  font-size: 17px;
  text-transform: uppercase;
}

body.page-ticket .meta {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.35;
}

body.page-ticket .voucher {
  margin: 8px 0;
  padding: 8px 0;
  border-top: 1px dashed #111;
  border-bottom: 1px dashed #111;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

body.page-ticket .tiny {
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
}

@media screen {
  body.page-ticket {
    background: #f8fafc;
    display: grid;
    place-items: start center;
    min-height: 100vh;
    padding: 12px;
  }

  body.page-ticket .ticket {
    background: #fff;
    border: 1px solid #ddd;
  }
}
