/* ════════════════════════════════════════════════════════════
   Toyota Ajánlat-testreszabó — Design System
   Fonts: Big Shoulders Display (display) · IBM Plex Sans (UI)
   Accent: #E10018  Background: #FFFFFF
════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@700;900&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input { font-family: inherit; }

/* ── Tokens ── */
:root {
  --red:         #E10018;
  --red-dark:    #B8001A;
  --red-dim:     rgba(225, 0, 24, 0.10);
  --ink:         #111111;
  --ink-mid:     #444444;
  --ink-light:   #8A8A8A;
  --silver:      #F5F5F5;
  --silver-mid:  #E2E2E2;
  --white:       #FFFFFF;
  --shadow-card: 0 1px 4px rgba(0,0,0,0.07), 0 6px 24px rgba(0,0,0,0.05);
  --font-d: 'Big Shoulders Display', 'Barlow Condensed', sans-serif;
  --font-u: 'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --ease:   200ms ease;
}

html, body {
  height: 100%;
  font-family: var(--font-u);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}


/* ════════════════════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════════════════════ */

.hidden { display: none !important; }

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg {
  font-size: 13px;
  color: var(--ink-light);
  min-height: 20px;
  line-height: 1.4;
}
.msg.error   { color: var(--red);    font-weight: 500; }
.msg.success { color: #1a7a37;       font-weight: 500; }


/* ════════════════════════════════════════════════════════════
   LOGIN PAGE
════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  background: var(--white);
}

/* Two-column grid: brand left | form right */
.login-split {
  display: grid;
  grid-template-columns: 52% 1fr;
  min-height: 100vh;
}

/* ── Brand panel (left, dark) ── */
.login-brand {
  background: #0F0F0F;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Red racing stripe at the seam */
.login-brand::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--red);
}

/* Soft red ambient glow */
.login-brand::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(ellipse 55% 55% at 65% 35%,
    rgba(225, 0, 24, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 60px 48px;
  text-align: center;
}

/* Toyota three-oval mark */
.toyota-oval {
  width: 128px;
  color: var(--white);
  animation: fadeSlideIn 0.9s cubic-bezier(.22,.68,0,1.2) both;
  filter: drop-shadow(0 2px 16px rgba(225,0,24,0.25));
}

.brand-wordmark {
  font-family: var(--font-d);
  font-size: 78px;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--white);
  line-height: 1;
  animation: fadeSlideIn 0.8s cubic-bezier(.22,.68,0,1.2) 0.08s both;
}

.brand-tagline {
  font-family: var(--font-u);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  animation: fadeSlideIn 0.8s ease 0.18s both;
}

/* ── Form panel (right, white) ── */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--white);
}

.login-card {
  width: 100%;
  max-width: 360px;
}

.login-heading {
  font-family: var(--font-d);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 8px;
}

.login-sub {
  font-size: 13px;
  color: var(--ink-light);
  margin-bottom: 36px;
  letter-spacing: 0.01em;
}


/* ════════════════════════════════════════════════════════════
   FORM FIELDS
════════════════════════════════════════════════════════════ */

.field-group { margin-bottom: 28px; }

.field-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 10px;
}

.field-input {
  display: block;
  width: 100%;
  padding: 10px 0;
  font-family: var(--font-u);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--silver-mid);
  border-radius: 0;
  outline: none;
  transition: border-color var(--ease);
  -webkit-appearance: none;
}

.field-input:focus       { border-bottom-color: var(--red); }
.field-input::placeholder { color: var(--ink-light); }


/* ════════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════════ */

/* Primary (red) — full-width login submit */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px 24px;
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  border: none;
  border-radius: 1px;
  cursor: pointer;
  margin-top: 36px;
  transition: background var(--ease), box-shadow var(--ease), transform 80ms ease;
}
.btn-primary:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 18px rgba(225,0,24,0.28);
}
.btn-primary:active   { transform: scale(0.988); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* Ghost — outline secondary button */
.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-u);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-mid);
  background: transparent;
  border: 1.5px solid var(--silver-mid);
  border-radius: 1px;
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease);
  text-decoration: none;
  line-height: 1;
}
.ghost:hover { color: var(--red); border-color: var(--red); }

/* Generate — bold red action */
.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  border: none;
  border-radius: 1px;
  cursor: pointer;
  transition: background var(--ease), box-shadow var(--ease), transform 80ms ease;
  white-space: nowrap;
}
.btn-generate:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 20px rgba(225,0,24,0.30);
}
.btn-generate:active   { transform: scale(0.988); }
.btn-generate:disabled { opacity: 0.55; cursor: not-allowed; }


/* ════════════════════════════════════════════════════════════
   EDITOR — TOP BAR
════════════════════════════════════════════════════════════ */

.bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--silver-mid);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 58px;
  gap: 16px;
}

/* Left red stripe */
.bar::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--red);
}

.bar-mark {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-left: 4px;
  text-decoration: none;
}

/* Oval is red in the bar */
.bar-mark .toyota-oval {
  width: 34px;
  color: var(--red);
  filter: none;
  animation: none;
}

.bar-name {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--ink);
  line-height: 1;
}

.bar-divider {
  width: 1px;
  height: 18px;
  background: var(--silver-mid);
  flex-shrink: 0;
}

.bar-title {
  font-family: var(--font-u);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-light);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-actions { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }


/* ════════════════════════════════════════════════════════════
   EDITOR — LAYOUT
════════════════════════════════════════════════════════════ */

.editor-page {
  min-height: 100vh;
  background: var(--silver);
  display: flex;
  flex-direction: column;
}

/* Centered content column */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* ════════════════════════════════════════════════════════════
   CARDS
════════════════════════════════════════════════════════════ */

.card {
  background: var(--white);
  border-radius: 1px;
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--silver);
}

.card-step {
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--red);
}

.card-title {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1;
}


/* ════════════════════════════════════════════════════════════
   UPLOAD ZONE
════════════════════════════════════════════════════════════ */

.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 44px 32px;
  border: 2px dashed var(--silver-mid);
  border-radius: 1px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.upload-zone:hover,
.upload-zone:focus-within {
  border-color: var(--red);
  background: var(--red-dim);
}

/* The actual file input fills the entire zone */
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--ink-light);
  transition: color var(--ease);
}

.upload-zone:hover .upload-icon,
.upload-zone:focus-within .upload-icon {
  color: var(--red);
}

.upload-prompt {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-mid);
}

.upload-hint-text {
  font-size: 12px;
  color: var(--ink-light);
  letter-spacing: 0.02em;
}


/* ════════════════════════════════════════════════════════════
   TITLE TEXT INPUT
════════════════════════════════════════════════════════════ */

.title-field {
  display: block;
  width: 100%;
  padding: 12px 0 10px;
  font-family: var(--font-d);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--silver-mid);
  border-radius: 0;
  outline: none;
  transition: border-color var(--ease);
  -webkit-appearance: none;
}

.title-field:focus { border-bottom-color: var(--red); }
.title-field::placeholder { color: var(--silver-mid); }

.char-note {
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-light);
  text-align: right;
  letter-spacing: 0.02em;
}


/* ════════════════════════════════════════════════════════════
   IMAGE SLOTS
════════════════════════════════════════════════════════════ */

/* .slots container */
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* Each .slot card (class added by app.js) */
.slot {
  background: var(--silver);
  border: 1px solid var(--silver-mid);
  border-radius: 1px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--ease);
}

.slot:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.11); }

.slot img {
  display: block;
  width: 100%;
  height: 156px;
  object-fit: cover;
  background: var(--silver-mid);
}

/* "Új kép" label that wraps the hidden file input */
.slot label {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
  cursor: pointer;
  border-top: 1px solid var(--silver-mid);
  transition: color var(--ease), background var(--ease);
}

.slot label::before {
  content: '＋';
  font-size: 13px;
  color: var(--red);
  margin-right: 7px;
  line-height: 1;
}

.slot label:hover {
  color: var(--red);
  background: var(--red-dim);
}

/* The file input itself is invisible; clicking the label opens the dialog */
.slot label input[type="file"] {
  display: none;
}


/* ════════════════════════════════════════════════════════════
   GENERATE ROW
════════════════════════════════════════════════════════════ */

.generate-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* ── edit section wrapper ── */
#editSection {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* When .hidden is removed, flex applies; when .hidden is present, !important wins */
#editSection.hidden { display: none !important; }


/* ════════════════════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════════════════════ */

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


/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .login-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .login-brand {
    min-height: 230px;
    padding: 40px 24px;
  }

  .toyota-oval     { width: 72px; }
  .brand-wordmark  { font-size: 52px; }
  .brand-tagline   { letter-spacing: 0.14em; }

  .login-form-panel { padding: 36px 24px; }

  .bar {
    padding: 0 16px;
    height: 50px;
  }

  .bar-title, .bar-divider { display: none; }

  .wrap   { padding: 24px 16px 48px; }
  .card   { padding: 22px 18px; }

  .generate-row { flex-direction: column; align-items: flex-start; }
}
