:root {
  --brand: #0070D7;
  --text-on-brand: #ffffff;
  --field-bg: #ffffff;
  --field-text: #111111;
  --field-border: rgba(255,255,255,0.35);
  --focus: #ffffff;
  --muted: rgba(255,255,255,0.85);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,0.25);
  --gap: 14px;
  --container-max: 460px;
  --content-pad-inline: 24px;
}

* { box-sizing: border-box; }
/* Header Banner Styles */
.header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #0072ce;
  color: white;
  padding: 16px 0;
  border-radius: 8px;
  margin: 0;
  width: 100%;
  text-align: left;
}

.header-text {
  max-width: 60%;
}

.brand {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.brand-white {
  color: #ffffff;
}

.brand-yellow,
#ideasTitle.brand-yellow {
  color: #fea229 !important;
}

.generator-title {
  font-size: 1.5rem;
  color: #fea229;
  margin: 5px 0;
}

.tagline {
  font-size: 1rem;
  line-height: 1.4;
  color: #ffffff;
}

.header-image img,
.header-image video,
.header-image .header-media {
  display: block;
  max-width: 150px;
  height: auto;
}

/* SVG logo size: 35px on mobile, 45px on desktop */
.brand-logo {
  height: 30px;   /* mobile/default */
  width: auto;    /* preserve aspect ratio */
  display: block; /* avoid inline-gap issues */
}

@media (min-width: 601px) { /* pairs with existing max-width: 600px */
  .brand-logo {
    height: 40px; /* desktop */
  }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .header-banner {
    flex-direction: column;
    text-align: center;
  }
  .header-text {
    max-width: 100%;
  }
  .brand-logo {
    display: block;
    margin: 0 auto; /* center logo on mobile */
  }
  .header-image img,
  .header-image video,
  .header-image .header-media {
    margin-top: 15px;
    max-width: 120px;
  }
}

html, body { height: 100%; }

a[href^="https://credit24.ee/blog/iga-tund-uks-tasuta-ostukorv"],
a[href^="https://documents.ipfdigital.io/mobilewallet/EE/EE_Privacy_Notice.pdf"] {
  color: white;
  text-decoration: underline;
  font-size: 13px;
}

body {
  height: 100%;
  margin: 0;
  font-family: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--brand);
  color: var(--text-on-brand);
}

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px 0;
}

.card {
  width: 100%;
  max-width: var(--container-max);
  background: var(--brand);
  border-radius: var(--radius);
  padding: 0 var(--content-pad-inline);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.logo {
  width: 40px;
  height: 40px;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.25;
}
p.subtle {
  margin: 0 0 18px 0;
  color: var(--muted);
  font-size: 14px;
}

form {
  display: grid;
  gap: var(--gap);
}

label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-on-brand);
}

.field {
  position: relative;
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--field-text);
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 5px;
  background: linear-gradient(to right, #ffab00 0%, #ffab00 var(--value, 0%), rgba(255,255,255,0.6) var(--value, 0%), rgba(255,255,255,0.6) 100%);
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 5px;
  background: linear-gradient(to right, #ffab00 0%, #ffab00 var(--value, 0%), rgba(255,255,255,0.6) var(--value, 0%), rgba(255,255,255,0.6) 100%);
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 5px;
  background: linear-gradient(to right, #ffab00 0%, #ffab00 var(--value, 0%), rgba(255,255,255,0.6) var(--value, 0%), rgba(255,255,255,0.6) 100%);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px; /* centers thumb vertically on track */
  border-radius: 50%;
  background: #fea229;
  border: 2px solid #0070D7;
  cursor: pointer;
  transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fea229;
  border: 2px solid #0070D7;
  cursor: pointer;
  margin-top: 0; /* ensure alignment in Firefox */
}
input[type="range"]:hover {
  background: rgba(255,255,255,0.8);
}

textarea {
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  color: var(--field-text);
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: rgba(255,255,255,0.8);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.28);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.price-badge {
  background: #fea229;
  border: none;
  color: #111111;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 999px;
  min-width: 60px;
  text-align: center;
}

.checkbox-container {
  display: none;
  justify-content: center;
  margin-top: 12px;
  text-align: center;
}
#marketingCheckboxContainer {
  display: flex;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.checkbox input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #fea229;
}
.checkbox label {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
}

#rulesCheckbox label,
#marketingCheckbox label {
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  width: 100%;
}

#submitActionsContainer {
  margin-bottom: 40px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.04s ease, opacity 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Make Saada ja Osale and Genereeri uuesti buttons full width */
#submitBtn,
#generateBtn {
  width: 100%;
  justify-content: center;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-primary {
  background: #fea229;
  color: #111111;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}
.btn-primary:hover:not([disabled]) {
  background: #e69a00;
}
.btn-ghost {
  background: transparent;
  color: var(--text-on-brand);
  border: 2px solid #fea229;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.btn-ghost:hover:not([disabled]) {
  background: rgba(255,171,0,0.1);
  border-color: #fea229;
}

.divider {
  height: 1px;
  background: rgba(255,255,255,0.25);
  margin: 6px 0 2px 0;
  border-radius: 1px;
}

/* Ideas list */
#ideasSection {
  display: none;
  margin-top: 6px;
}
#ideasSection h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-align: center;
  color: var(--brand-yellow);
}
.ideas-grid {
  display: grid;
  gap: 12px;
}
.idea-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
  padding: 14px 14px 14px 44px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.idea-card:hover {
  background: rgba(255,255,255,0.1);
}
.idea-radio {
  position: absolute;
  left: 12px;
  top: 16px;
  width: 18px;
  height: 18px;
  accent-color: #ffffff;
  cursor: pointer;
}
.idea-radio:checked {
  accent-color: #fea229;
}
.idea-title {
  font-weight: 600;
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #fff;
}
.idea-details {
  margin: 0 0 8px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 400;
}
.idea-price {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.idea-card.selected {
  border: 2px solid #fea229;
  box-shadow: 0 0 0 4px rgba(255,204,0,0.35);
  background: rgba(255,255,255,0.12);
}
.idea-card.selected .idea-title {
  color: #fea229;
}

.helper {
  font-size: 12px;
  color: var(--muted);
  margin-top: -6px;
}

.error {
  color: #ffefef;
  background: rgba(255,0,0,0.12);
  border: 1px solid rgba(255,0,0,0.35);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}

.loading {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.success {
  text-align: center;
  padding: 40px 10px;
  display: none;
}
.success h2 {
  font-size: 22px;
  margin: 0 0 6px 0;
  color: var(--brand-yellow) !important;
}
.success p {
  margin: 0;
  color: var(--muted);
}

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

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