/* =========================
   Design tokens
   ========================= */

:root {
  --bg-main: #f5f7fb;
  --bg-card: #ffffff;
  --bg-muted: #f0f3f9;

  --text-main: #0f172a;
  --text-muted: #475569;

  --border-light: #e2e8f0;

  --danger: #b91c1c;
  --success: #15803d;

  --radius: 14px;
  --radius-sm: 10px;

  /* Button system */
  --btn-main: #4f46e5;
  --btn-hover: #4338ca;
  --btn-glow: rgba(79, 70, 229, 0.45);
}

/* =========================
   Reset & base
   ========================= */

* {
  box-sizing: border-box;
}

html, body {
  height: 110vh;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-image: radial-gradient(
    circle 476px at 54.8% 51.5%,
    rgba(168,229,253,1) 0%,
    rgba(244,244,254,1) 42.3%,
    rgba(244,244,254,1) 100.2%
  );
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

/* =========================
   Layout
   ========================= */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px;
}

header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

header .meta {
  margin-top: 6px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06);
}

/* =========================
   Typography helpers
   ========================= */

.meta {
  color: var(--text-muted);
  font-size: 14px;
}

.meta.small {
  font-size: 12px;
}

.ok { color: var(--success); }
.bad { color: var(--danger); }

/* =========================
   Forms
   ========================= */

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 14px;
}

textarea {
  width: 100%;
  height: 80px;
  max-height: 180px;
  resize: vertical;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--btn-main);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

input[type="number"] {
  width: 120px;
}

input[type="checkbox"] {
  accent-color: var(--btn-main);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: var(--btn-main);
  color: #fff;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  
  font-weight: 700;
  letter-spacing: 0.2px;

  cursor: pointer;
  transition: background 0.2s ease;
}

    /* File selector button intentionally simpler:
      ::file-selector-button has browser limitations,
      no gradient or shadow on purpose */
input[type="file"]::file-selector-button:hover {
  background: var(--btn-hover);
}

input[type="file"]::file-selector-button:active {
  transform: translateY(1px);
}

/* =========================
   Fieldsets
   ========================= */

.contact-box,
.tone-box {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 18px 18px;
  margin-top: 16px;
  background: #f3f6fb;
  border: 1px solid #e6eaf2;
}

.tone-box {
  background: var(--bg-muted);
}

.contact-box legend,
.tone-box legend {
  padding: 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.tone-box label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  margin-top: 6px;
  font-weight: normal;
  cursor: pointer;
}

/* =========================
   Layout helpers
   ========================= */

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.col {
  flex: 1;
  min-width: 220px;
}

/* =========================
   BUTTON SYSTEM
   ========================= */

/* Base */
button,
.btn {
  position: relative;
  z-index: 1; /* ⬅️ důležité */

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;

  color: #fff;
  background: var(--btn-main);
  border: none;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;

  box-shadow: 0 6px 18px rgba(0,0,0,0.15);

  transition:
    box-shadow 0.25s ease,
    transform 0.05s ease;
}


/* Gradient overlay */
button::before,
.btn::before {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    120deg,
    var(--btn-hover),
    var(--btn-main),
    var(--btn-hover)
  );

  background-size: 200% 200%;
  background-position: 100% 50%;

  transition: background-position 0.45s ease;
  z-index: -1;
}


/* Hover */
button:hover::before,
.btn:hover::before {
  background-position: 0% 50%;
}

button:hover,
.btn:hover {
  box-shadow: 0 10px 28px var(--btn-glow);
}

/* Active */
button:active,
.btn:active {
  transform: translateY(1px);
}

/* Disabled */
button:disabled,
.btn.disabled {
  background: #a5b4fc;
  cursor: not-allowed;
  box-shadow: none;
}

button:disabled::before,
.btn.disabled::before {
  display: none;
}

/* =========================
   Usage & Premium badge
   ========================= */

.usage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.usage-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* Badge styled like btn */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 10px 14px;
  border-radius: 12px;

  font-size: 13px;
  font-weight: 600;
  line-height: 1;

  color: var(--btn-main);
  background: rgba(79, 70, 229, 0.10);

  white-space: nowrap;
}

.premium-icon {
  font-size: 14px;
  line-height: 1;
}

/* =========================
   Secondary buttons
   ========================= */

.output-actions button,
.reset-form button {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.output-actions button::before,
.reset-form button::before {
  display: none;
}

.output-actions button:hover,
.reset-form button:hover {
  background: var(--bg-muted);
}

/* =========================
   Output
   ========================= */

.output-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

pre {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e5e7eb;
  padding: 18px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

/* =========================
   Errors & footer
   ========================= */

.error {
  margin-top: 10px;
  color: var(--danger);
  font-weight: 600;
}

footer {
  margin-top: auto;
  padding: 5px 12px;
  font-size: 13px;
  color: #bebebe;
  text-align: center;
  border-top: 1px solid var(--border-light);
  background: #000000;
}

footer a,
footer a:visited {
  color: #b6b1ff;
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  text-decoration: underline;
  color: #d0ccff;
}

footer p{
  margin: 0px;
}


/* =========================
   Print
   ========================= */

@media print {
  body * { visibility: hidden; }
  .print-area,
  .print-area * { visibility: visible; }
  .print-area {
    position: absolute;
    inset: 0;
    padding: 24px;
  }
}

/* =========================
   Apply logo block
   ========================= */

.apply-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  height: 117px;
  width: 200px;

  text-decoration: none;
  user-select: none;
}

.apply-logo-img {
  display: block;
  width: 200px;
  height: auto;
}

/* Text under globe */
.apply-logo-text {
  margin-top: 4px;
  text-align: center;
  line-height: 1.1;
}

.apply-logo-title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.15em;
  color: var(--btn-main);
}

.apply-logo-subtitle {
  margin-top: 2px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--btn-main);
  opacity: 0.9;
}

.apply-logo:hover {
  opacity: 0.92;
}