:root {
  --bg: #ffffff;
  --text: #003774;
  --accent: #e85252;
  --accent-dark: #c94444;
  --muted: #e9eff7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid #e3e9f1;
}

.logo {
  font-weight: 700;
  font-size: 20px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.lang-select {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.lang-select select {
  border: 1px solid #d8e2f0;
  background: #f7fafc;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.screens {
  flex: 1;
  padding: 28px;
  display: grid;
}

.screen {
  display: none;
  align-items: center;
  text-align: center;
  height: 100%;
  overflow: auto;
  justify-content: center;
  animation: fade 0.35s ease;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.title {
  margin: 10px 0 6px;
  font-size: 32px;
}

.subtitle {
  margin: 0 0 26px;
  font-size: 18px;
  opacity: 0.9;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: min(1000px, 100%);
}

.choice {
  height: 300px;
  padding: 40px 20px;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid var(--text);
  background: #f3f7fb;
  border-radius: 18px;
  cursor: pointer;
}

.form {
  display: grid;
  gap: 18px;
  max-width: 520px;
  width: 100%;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  text-align: left;
}

input {
  border: 2px solid #d8e2f0;
  border-radius: 12px;
  font-size: 20px;
  padding: 14px 16px;
  color: var(--text);
  background: #fff;
}

input:focus {
  outline: 3px solid #cfe1ff;
  border-color: #9dbaf0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.form-actions.center {
  justify-content: center;
}

.primary,
.secondary {
  font-size: 18px;
  padding: 14px 28px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #f3f7fb;
  color: var(--text);
  border: 2px solid #d8e2f0;
}

.error {
  min-height: 24px;
  color: var(--accent);
  font-weight: 600;
  flex-basis: 100%;
  text-align: center;
}

.hint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 30px;
  width: min(900px, 100%);
}

.hint {
  height: 150px;
  border: 2px solid #d8e2f0;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: center;
  background: #f8fbff;
}

.hint .icon {
  font-size: 64px;
}

.card {
  height: 300px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  border: 2px solid #d8e2f0;
  border-radius: 20px;
  margin: 24px;
  padding: 24px;
  background: #f8fbff;
  align-items: center;
  width: min(820px, 100%);
}

.card-details {
  display: grid;
  gap: 10px;
  font-size: 18px;
}

.label {
  font-weight: 700;
}

.qr {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 160px;
  border: 2px dashed #c7d6ea;
  border-radius: 16px;
  background: #fff;
  padding: 24px;
}

.notice {
  font-size: 20px;
  max-width: 680px;
  padding: 64px 0;
}

.keyboard {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #eef3f9;
  border-top: 2px solid #d2dce9;
  padding: 16px 20px 22px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.keyboard.visible {
  transform: translateY(0);
}

body.keyboard-open .screen {
  padding-bottom: 280px;
  justify-content: flex-start;
}

.keys {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  gap: 10px;
  grid-auto-flow: column;
}

.row button {
  font-size: 18px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  min-width: 44px;
}

.row button.action {
  background: var(--text);
  color: #fff;
}

@media (max-width: 900px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .card {
    grid-template-columns: 1fr;
  }

  .hint-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
    body {
        font-family: sans-serif;
        font-size: 12pt;
    }

    .topbar, .form-actions {
        display: none !important;
    }
}
