/* ---------- Theme variables (mirrors github/qr) ---------- */
:root {
  --bg-primary: #1b1f24;
  --bg-secondary: #21262d;
  --bg-tertiary: #0d1117;
  --border: #484f58;
  --border-muted: #30363d;
  --text-primary: #ffffff;
  --text-muted: #8b949e;
  --accent: #30c464;
  --accent-dark: #216e39;
  --accent-hover: #3fd773;
  --danger: #f85149;
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Mona Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue',
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 24px 3rem;
}

.home {
  margin-top: 2.5rem;
}

.qr_form__qr_code_container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

/* ---------- Header ---------- */
.qr_code_generator_header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.qr_code_generator_header_wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.logo_mark {
  color: var(--text-primary);
  display: inline-flex;
}

.qr_code_generator_title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.qr_code_generator_header_subtitle_text {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: 0.25rem;
}

.header_meta .header_link {
  font-size: 14px;
  color: var(--text-muted);
}
.header_meta .header_link:hover {
  color: var(--accent);
}

/* ---------- Form ---------- */
.qr_form_container {
  width: 560px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field_group {
  border: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field_group.hidden,
.hidden {
  display: none !important;
}

.form_field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form_row {
  display: flex;
  gap: 1rem;
}

.flex_grow {
  flex: 1 1 0;
  min-width: 0;
}

.field_label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.field_caption {
  font-size: 12px;
  color: var(--text-muted);
}

.text_input,
.select_input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text_input:focus,
.select_input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(48, 196, 100, 0.25);
}

.select_input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='%238b949e'><path d='M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.checkbox_field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox_field input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.input_with_status {
  position: relative;
}

.input_with_status .text_input {
  padding-right: 7rem;
}

.lookup_status {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.lookup_status.is-error {
  color: var(--danger);
}

.lookup_status.is-ok {
  color: var(--accent);
}

.qr_size_format_theme_input_container {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.25rem;
}

.qr_size_format_theme_input_container .form_field {
  flex: 1 1 0;
  min-width: 0;
}

/* ---------- Button ---------- */
.primary_button {
  margin-top: 0.75rem;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--accent-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.primary_button:hover {
  background-color: #2ea043;
}

.primary_button:active {
  transform: translateY(1px);
}

.error_text {
  color: var(--danger);
  font-size: 14px;
  margin-top: 0.25rem;
}

/* ---------- QR preview card ---------- */
.qr__qr_preview {
  flex-shrink: 0;
}

.qr__qr_card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--bg-secondary);
  box-shadow: 0px 100px 80px rgba(0, 0, 0, 0.0174624),
    0px 41.7776px 33.4221px rgba(0, 0, 0, 0.0235573),
    0px 22.3363px 17.869px rgba(0, 0, 0, 0.0282784),
    0px 12.5216px 10.0172px rgba(0, 0, 0, 0.0339075),
    0px 6.6501px 5.32008px rgba(0, 0, 0, 0.04317),
    0px 2.76726px 2.21381px rgba(0, 0, 0, 0.07);
  padding: 24px;
  width: 452px;
}

.qr__qr_code {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.qr__qr_code canvas,
.qr__qr_code svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr_code_generator__automatic_refresh_note {
  margin-top: 1.5rem;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 1100px) {
  .qr_form__qr_code_container {
    flex-direction: column;
    align-items: center;
  }

  .qr_form_container {
    width: 100%;
    max-width: 560px;
  }
}

@media screen and (max-width: 640px) {
  .container {
    padding: 1.5rem 16px 2rem;
  }

  .qr_code_generator_header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .qr_code_generator_title {
    font-size: 36px;
  }

  .qr__qr_card {
    width: 100%;
    max-width: 380px;
  }

  .form_row {
    flex-direction: column;
  }

  .qr_size_format_theme_input_container {
    flex-direction: column;
  }
}
