/* ===== Root Variables ===== */
:root {
  --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

  /* Color system */
  --color-bg: #f7f9fc;
  --color-text: #1e293b;
  --color-heading: #1f2937;
  --color-muted: #374151;
  --color-border: #e2e8f0;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;

  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;

  --color-note-bg: #e6fffa;
  --color-note-border: #14b8a6;

  --color-white: #fff;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top left, #f7f9fc, #edf2f7);
  color: var(--color-text);
  margin: 0;
  padding: 1.5rem 0.75rem;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 600px;
  width: 100%;
}

/* ===== Typography ===== */
h1 {
  font-weight: 700;
  font-size: 1.8rem;
  margin: 0 0 0.4rem;
  color: var(--color-heading);
  text-align: center;
}

p.lead {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--color-muted);
  font-size: 1.1rem;
}

h2 {
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--color-heading);
  margin-top: 0.4rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.2rem;
}

/* ===== Lists ===== */
ul,
ol {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

ul {
  list-style-position: inside;
  padding-left: 0;
}

ul li,
ol li {
  margin-bottom: 0.4rem;
  line-height: 1.4;
  font-size: 1rem;
}

/* ===== Container ===== */
.calculator-container {
  background: var(--color-white);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  transition: box-shadow 0.3s ease;
}

.calculator-container:hover {
  box-shadow: var(--shadow-hover);
}

/* ===== Forms ===== */
label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-heading);
  font-size: 1rem;
}

input[type='number'],
textarea,
select {
  border: 1.8px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  width: 100%;
  font-family: inherit;
  color: var(--color-heading);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  resize: vertical;
}

input[type='number']:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

input[type='number']:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px dashed var(--color-primary);
  outline-offset: 2px;
}

textarea {
  min-height: 90px;
}

/* ===== Layout Helpers ===== */
.flex-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
}

.flex-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.flex-row select {
  flex: 0 0 110px;
  border-radius: var(--radius);
}

/* ===== Buttons ===== */
button {
  background-color: var(--color-primary);
  border: none;
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  margin-top: 0.4rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}

.save-btn {
  margin-top: 1.25rem;
  background-color: var(--color-accent);
}

.save-btn:hover {
  background-color: var(--color-accent-hover);
}

/* ===== Output Section ===== */
#result {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--color-heading);
  min-height: 1.5em;
  text-align: center;
}

#qrcode {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
}

#qrcode canvas {
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ===== Note Box ===== */
.note {
  background-color: var(--color-note-bg);
  border-left: 6px solid var(--color-note-border);
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: #2c7a7b;
  border-radius: var(--radius);
  width: 100%;
  margin-bottom: 2rem;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ===== Highlights ===== */
.highlight {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.8rem;
  display: inline-block;
  margin-top: 0.25rem;
}

/* ===== Responsive ===== */
@media (max-width: 500px) {
  .flex-row {
    flex-direction: column;
    max-width: 100%;
  }

  .flex-row select {
    flex: 1 1 auto;
    width: 100%;
  }
}
