/* =================================================================
   OneMin Redirect kezelő
   - Login: diszpécser (shadcn/Outfit, light, piros) design tokenek
   - Dashboard: onemin.hu brand (Bricolage Grotesque + Barlow, krém/piros)
   ================================================================= */

:root {
  /* onemin.hu brand */
  --brand-red: #e73423;
  --brand-red-dark: #c92a1c;
  --brand-black: #000;
  --cream: #f4f1ea;
  --cream-2: #eae5d8;
  --white: #fff;
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Barlow", sans-serif;

  /* diszpécser (shadcn) tokenek */
  --d-bg: hsl(0 0% 96%);
  --d-card: hsl(0 0% 98%);
  --d-fg: hsl(0 0% 9%);
  --d-muted: hsl(0 0% 45%);
  --d-primary: hsl(5 80% 52%);
  --d-primary-dark: hsl(5 80% 42%);
  --d-border: hsl(0 0% 83%);
  --d-radius: 0.75rem;
  --d-font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --d-shadow: 0 1px 3px 0 hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
}

* { box-sizing: border-box; }

/* A hidden attribútum mindig elsőbbséget élvez (különben a .auth display:flex
   felülírná, és a login nem tűnne el bejelentkezés után). */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--brand-black); background: var(--white); }

/* ============================ LOGIN (split /auth design) ============================ */
.auth {
  display: flex;
  min-height: 100vh;
  font-family: var(--d-font);
}

/* --- Bal piros hero --- */
.auth__hero {
  position: relative;
  flex: 1 1 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 6vw;
  background: var(--brand-red);
  color: var(--white);
}
.auth__blob {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}
.auth__blob--1 { width: 230px; height: 230px; top: -40px; right: 16%; }
.auth__blob--2 { width: 560px; height: 560px; bottom: -160px; right: -120px; }
.auth__blob--3 { width: 120px; height: 120px; top: 22%; right: 6%; background: rgba(255, 255, 255, 0.05); }

.auth__hero-content { position: relative; z-index: 1; max-width: 540px; }
.auth__hero-logo { height: 52px; width: auto; display: block; margin-bottom: 56px; }
.auth__hero-title {
  margin: 0 0 16px;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.auth__hero-subtitle {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
}

/* --- Jobb form panel --- */
.auth__form-side {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f4f4f5;
}
.auth__card {
  width: 100%;
  max-width: 600px;
  background: var(--white);
  border: 1px solid #ececed;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 48px;
}

.auth__title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  color: #18181b;
}
.auth__subtitle {
  margin: 0 0 32px;
  font-size: 16px;
  color: #71717a;
}

.field { margin-bottom: 22px; }
.field label {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #27272a;
}
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #9ca3af;
  pointer-events: none;
}
.field input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 48px;
  font-family: var(--d-font);
  font-size: 16px;
  color: #18181b;
  background: #f7f7f8;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input::placeholder { color: #9ca3af; }
.field input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(231, 52, 35, 0.13);
}

/* Emlékezz rám */
.remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 24px;
  cursor: pointer;
  user-select: none;
}
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.remember__box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #d4d4d8;
  border-radius: 6px;
  background: var(--white);
  color: transparent;
  transition: background 0.15s, border-color 0.15s;
}
.remember__box svg { width: 14px; height: 14px; }
.remember input:checked + .remember__box,
.remember.is-checked .remember__box {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: var(--white);
}
.remember input:focus-visible + .remember__box { box-shadow: 0 0 0 3px rgba(231, 52, 35, 0.2); }
.remember__label { font-size: 15px; color: #52525b; }

.login-btn {
  width: 100%;
  height: 56px;
  font-family: var(--d-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  background: var(--brand-red);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--brand-red-dark); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth__error {
  margin: 14px 0 0;
  font-size: 14px;
  color: #dc2626;
  text-align: center;
}
.auth__forgot {
  display: block;
  margin-top: 20px;
  text-align: center;
  font-size: 15px;
  color: #71717a;
  text-decoration: none;
  transition: color 0.15s;
}
.auth__forgot:hover { color: var(--brand-red); }

@media (max-width: 900px) {
  .auth__hero { display: none; }
  .auth__form-side { flex-basis: 100%; }
}

/* ============================ DASHBOARD ============================ */
.topbar {
  background: var(--brand-red);
  background-image: linear-gradient(180deg, #e7342300, #e734231a);
}
.topbar__inner {
  max-width: none;
  margin: 0 auto;
  height: 58px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar__logo img { height: 28px; width: auto; display: block; filter: brightness(0) invert(1); }
.topbar__right { display: flex; align-items: center; gap: 16px; }
.topbar__ip {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.topbar__ip strong { font-weight: 700; }

.page {
  max-width: none;
  margin: 0 auto;
  padding: 28px 32px 48px;
}
.page__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 100%;
  letter-spacing: -0.9px;
  text-transform: uppercase;
  color: var(--brand-black);
  margin: 0;
}
.page__subtitle {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: #4a4a4a;
  margin: 4px 0 0;
}
.page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* Nagy, jól látható "Új redirect" gomb */
.pill--add {
  height: 50px;
  padding: 0 26px;
  font-size: 16px;
  color: var(--white);
  background: var(--brand-red);
  box-shadow: 0 6px 18px rgba(231, 52, 35, 0.35);
}
.pill--add:hover { background: var(--brand-red-dark); transform: scale(1.03); }
.pill__plus { font-size: 20px; line-height: 1; margin-right: 2px; }

/* Modal input */
.modal__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  margin-bottom: 22px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--brand-black);
  background: #f7f7f8;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.modal__input:focus { outline: none; border-color: var(--brand-red); background: var(--white); box-shadow: 0 0 0 3px rgba(231, 52, 35, 0.13); }

.panel {
  background: var(--cream);
  border-radius: 1.2rem;
  padding: 20px 22px;
  margin-bottom: 16px;
}

/* 2/3 táblázat – 1/3 chart elrendezés */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.dashboard-grid .panel { margin-bottom: 0; min-width: 0; }
.chart-panel { display: flex; flex-direction: column; position: relative; }
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Line chart (SVG) */
.chart { flex: 1; min-height: 180px; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #e3ddd0; stroke-width: 1; }
.chart-axis { stroke: #cfc8b8; stroke-width: 1; }
.chart-area { fill: rgba(231, 52, 35, 0.08); }
.chart-line { fill: none; stroke: var(--brand-red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: #fff; stroke: var(--brand-red); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-hit:hover { fill: rgba(231, 52, 35, 0.16); }
.chart-ylabel { fill: #9a9a9a; font-family: var(--font-body); font-size: 11px; font-weight: 600; }
.chart-xlabel { fill: #9a9a9a; font-family: var(--font-body); font-size: 10px; font-weight: 700; text-anchor: middle; }
.chart__empty { font-family: var(--font-body); font-size: 14px; color: #9a9a9a; }

/* Pont-kattintásra megjelenő domain-lista */
.chart-pop {
  position: absolute;
  z-index: 5;
  width: 230px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
}
.chart-pop__head {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--brand-black);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chart-pop__close {
  border: none;
  background: transparent;
  color: #9a9a9a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.chart-pop__close:hover { color: var(--brand-red); }
.chart-pop ul { list-style: none; margin: 0; padding: 0; }
.chart-pop li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--cream);
}
.chart-pop li:last-child { border-bottom: none; }
.chart-pop li a { color: var(--brand-red); text-decoration: none; word-break: break-all; }
.chart-pop li a:hover { text-decoration: underline; }
.chart-pop li span { color: #9a9a9a; white-space: nowrap; }
.panel__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--brand-black);
  margin: 0 0 14px;
  letter-spacing: -0.02rem;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel__head .panel__title { margin: 0; }

/* Pill buttons (onemin.hu) */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  border-radius: 90px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pill--sm { height: 34px; padding: 0 16px; font-size: 13px; }
.pill--primary { background: var(--brand-black); color: var(--white); }
.pill--primary:hover { transform: scale(1.02); }
.pill--primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.pill--outline {
  background: transparent;
  color: var(--brand-black);
  border-color: rgba(0, 0, 0, 0.25);
}
.pill--outline:hover { background: var(--brand-black); color: var(--white); border-color: var(--brand-black); }
.topbar .pill--outline { color: var(--white); border-color: rgba(255, 255, 255, 0.6); }
.topbar .pill--outline:hover { background: var(--white); color: var(--brand-red); border-color: var(--white); }
.pill__arrow { font-size: 18px; line-height: 1; }

/* Add form */
.add-form { display: flex; gap: 12px; flex-wrap: wrap; }
.add-form input {
  flex: 1;
  min-width: 220px;
  height: 42px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--brand-black);
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: 90px;
}
.add-form input:focus { outline: none; border-color: var(--brand-red); }

/* Kereső */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9a9a9a;
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 18px 0 44px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--brand-black);
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: 90px;
}
.search-input:focus { outline: none; border-color: var(--brand-red); }

/* Table — fix magasság, belül görgethető, sticky fejléc */
#table-wrap {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--cream-2);
  border-radius: 12px;
}
#redirect-table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: 15px; }
#redirect-table th, #redirect-table td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--cream-2); }
#redirect-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--white);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a6a6a;
  box-shadow: inset 0 -1px 0 var(--cream-2);
}
#redirect-table tbody tr:last-child td { border-bottom: none; }
#redirect-table tbody tr:hover { background: var(--cream); }

.cell-domain { white-space: nowrap; }
.cell-domain a { font-size: 15px; }

/* SSL lejárat oszlop */
.cell-cert { white-space: nowrap; }
.cert {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 90px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}
.cert--ok { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.cert--soon { background: rgba(180, 83, 9, 0.12); color: #b45309; }
.cert--warn { background: rgba(231, 52, 35, 0.13); color: var(--brand-red); }
.cert--exp { background: rgba(231, 52, 35, 0.15); color: var(--brand-red); }
.cert--na { background: rgba(0, 0, 0, 0.06); color: #8a8a8a; }
.cert--moved { background: rgba(180, 83, 9, 0.12); color: #b45309; }
.cert-date { font-family: var(--font-body); font-size: 12px; color: #9a9a9a; margin-left: 6px; }

.th-action { width: 220px; }
.cell-action { text-align: right; white-space: nowrap; width: 1%; }
.row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  border-radius: 90px;
  color: #4a4a4a;
  border: 1px solid var(--cream-2);
  background: var(--white);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.row-btn + .row-btn { margin-left: 8px; }
/* id-szint, hogy felülírja a #redirect-table a piros színt (különben hoverkor
   piros szöveg piros háttéren eltűnik) */
#redirect-table .open-btn { color: #4a4a4a; font-weight: 600; }
#redirect-table .open-btn:hover { background: var(--brand-red); color: var(--white); border-color: var(--brand-red); }
.renew-btn:hover { background: #2e7d32; color: var(--white); border-color: #2e7d32; }
.renew-btn--blocked { color: #b0b0b0; border-style: dashed; cursor: not-allowed; }
.renew-btn--blocked:hover { background: var(--white); color: #b0b0b0; border-color: var(--cream-2); }

/* Fejléc gombcsoport (darabszám + frissítés) */
.panel__head-actions { display: flex; align-items: center; gap: 8px; }
.pill:disabled { cursor: default; opacity: 1; }
.pill--count { color: #6a6a6a; }
.pill--count:hover { background: transparent; color: #6a6a6a; border-color: rgba(0, 0, 0, 0.25); }

/* Megerősítő modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.modal__box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--brand-black);
}
.modal__text {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: #3a3a3a;
  margin: 0 0 22px;
}
.modal__text strong { color: var(--brand-black); }
.modal__warn { color: var(--brand-red); font-weight: 600; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; }
#renew-result { margin: 16px 0 0; }
#redirect-table a { color: var(--brand-red); text-decoration: none; word-break: break-all; font-weight: 500; }
#redirect-table a:hover { text-decoration: underline; }

.ssl {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 90px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.ssl--on { background: rgba(56, 142, 60, 0.12); color: #2e7d32; }
.ssl--off { background: rgba(0, 0, 0, 0.07); color: #6a6a6a; }

.table-info { font-family: var(--font-body); font-size: 13px; color: #9a9a9a; margin: 12px 2px 0; }

.note { font-family: var(--font-body); font-size: 15px; color: #6a6a6a; margin: 0; }
.note.is-error { color: hsl(0 72% 50%); }
.note.is-ok { color: hsl(142 70% 32%); }

@media (max-width: 640px) {
  /* Topbar: kisebb, az IP külön sorba törhet */
  .topbar__inner { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 14px; gap: 6px 12px; }
  .topbar__logo img { height: 24px; }
  .topbar__right { gap: 10px; }
  .topbar__ip { font-size: 11px; }

  /* Page: szűkebb margók, fejléc + gomb egymás alá */
  .page { padding: 18px 14px 36px; }
  .page__head { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .page__title { font-size: 26px; }
  .pill--add { width: 100%; justify-content: center; }

  .panel { padding: 16px 14px; }

  /* Lista fejléc: cím fölött, gombok alatta */
  .panel__head { flex-wrap: wrap; gap: 10px; }

  /* Táblázat: vízszintes görgetés a dobozban, ne feszítse szét az oldalt */
  #table-wrap { -webkit-overflow-scrolling: touch; }
  #redirect-table { min-width: 520px; }

  /* Chart valamivel magasabb mobilon */
  .chart { min-height: 240px; }
  .chart-pop { width: 200px; }
}
