/* =============================================
   GenLP Studio — Main Stylesheet
   Aesthetic: Bold editorial meets clean utility
   ============================================= */

:root {
  --ink: #0d0d12;
  --ink-soft: #1e1e2e;
  --ink-muted: #3d3d5c;
  --paper: #f7f6f2;
  --paper-alt: #eeecE4;
  --white: #ffffff;
  --accent: #5b4cff;
  --accent-light: #7c6fff;
  --accent-glow: rgba(91,76,255,0.15);
  --gold: #e8a617;
  --rose: #ff4d6d;
  --green: #00c48c;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* ---- NAVBAR ---- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  padding: 0 2.5rem;
  height: 64px;
  background: rgba(247,246,242,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  font-size: 1.4rem;
  color: var(--accent);
}

.nav-links {
  display: flex; gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all .2s;
}

.nav-link:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-user {
  display: flex; align-items: center; gap: 10px;
  margin-left: 1rem;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--rose));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 0.85rem;
}

.user-name {
  font-weight: 500; font-size: 0.875rem;
}

.btn-logout {
  padding: 5px 12px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all .2s;
}

.btn-logout:hover {
  background: #ffeef0;
  border-color: var(--rose);
  color: var(--rose);
}

/* ---- FLASH ---- */
.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 2rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.flash--success { background: #d1fae5; color: #065f46; }
.flash--error   { background: #fde8ec; color: #9b1c1c; }
.flash--info    { background: #e0e7ff; color: #3730a3; }

.flash-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; opacity: .6;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 0.95rem;
  cursor: pointer; border: none;
  text-decoration: none;
  transition: all .2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent-glow);
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover {
  background: #d4940f;
  transform: translateY(-1px);
}

.btn-danger {
  background: #fde8ec;
  color: var(--rose);
  border: 1px solid #fbb;
}

.btn-danger:hover { background: #ffc0cc; }

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
  border-radius: 14px;
}

/* ---- PAGE WRAPPER ---- */
.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.page-header {
  margin-bottom: 2rem;
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}

.page-title {
  font-size: 2rem;
}

.page-subtitle {
  color: var(--ink-muted);
  font-size: 1rem;
  margin-top: 4px;
}

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-body {
  padding: 2rem;
}

.card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ---- FORMS ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-group {
  display: flex; flex-direction: column; gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.form-label span {
  color: var(--rose);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e5e3db;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: #fff;
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b8a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.color-row {
  display: flex; align-items: center; gap: 10px;
}

input[type="color"] {
  width: 48px; height: 40px;
  border: 1.5px solid #e5e3db;
  border-radius: 8px;
  padding: 3px;
  cursor: pointer;
  background: var(--paper);
}

/* ---- TEMPLATE PICKER ---- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.template-card {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all .25s;
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.template-card input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}

.template-card input:checked + .template-inner {
  border: none;
}

.template-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.template-preview {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

.template-info {
  padding: 10px 12px;
  background: var(--white);
}

.template-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.template-tag {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ---- DASHBOARD ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

/* ---- ITEMS LIST ---- */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.item-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}

.item-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.item-banner {
  height: 100px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}

.item-body {
  padding: 1.25rem;
}

.item-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.badge-lp   { background: #ede9fe; color: #5b21b6; }
.badge-inv  { background: #fef3c7; color: #92400e; }

.item-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.item-date {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.item-url {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-family: monospace;
  word-break: break-all;
}

.item-url a { color: var(--accent); text-decoration: none; }
.item-url a:hover { text-decoration: underline; }

.copy-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: .2s;
}

.copy-btn:hover { background: var(--accent-light); }

.item-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.item-views {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 10px;
}

/* ---- AUTH PAGES ---- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-left {
  background: var(--ink);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem;
  position: relative; overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 60%, rgba(91,76,255,0.3), transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(255,77,109,0.2), transparent 50%);
}

.auth-left-content {
  position: relative; z-index: 1;
  text-align: center; color: #fff;
}

.auth-logo {
  font-family: 'Syne', sans-serif;
  font-size: 3rem; font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1rem;
}

.auth-logo-icon {
  color: var(--accent-light);
}

.auth-tagline {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  max-width: 360px;
  line-height: 1.6;
}

.auth-features {
  margin-top: 2rem;
  display: flex; flex-direction: column; gap: 12px;
  text-align: left;
}

.auth-feature {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.9rem; color: rgba(255,255,255,0.85);
}

.auth-feature-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}

.auth-right {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
  background: var(--paper);
}

.auth-box {
  width: 100%; max-width: 420px;
}

.auth-title {
  font-size: 1.75rem; margin-bottom: 8px;
}

.auth-sub {
  color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 2rem;
}

.auth-form .form-group { margin-bottom: 1rem; }

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---- SECTION DIVIDERS ---- */
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--paper-alt), transparent);
}

.form-section {
  margin-bottom: 2.5rem;
}

/* ---- STEP FORM ---- */
.steps-bar {
  display: flex; align-items: center;
  gap: 0; margin-bottom: 2.5rem;
}

.step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1; position: relative;
}

.step::before {
  content: '';
  position: absolute;
  top: 18px; left: 50%; right: -50%;
  height: 2px;
  background: #e5e3db;
  z-index: 0;
}

.step:last-child::before { display: none; }

.step-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid #e5e3db;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  color: var(--ink-muted);
  position: relative; z-index: 1;
  transition: .2s;
}

.step.active .step-dot {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.step.done .step-dot {
  background: var(--green); border-color: var(--green); color: #fff;
}

.step-label {
  font-size: 0.72rem; font-weight: 600;
  color: var(--ink-muted);
  text-align: center;
}

.step.active .step-label { color: var(--accent); }
.step.done .step-label   { color: var(--green); }

.step-panel { display: none; }
.step-panel.active { display: block; }

/* ---- URL RESULT ---- */
.url-result-box {
  background: linear-gradient(135deg, var(--ink-soft), var(--ink));
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  color: #fff;
  margin-top: 1.5rem;
}

.url-result-box .url-display {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 14px 20px;
  font-family: monospace;
  font-size: 1rem;
  margin: 1.5rem 0;
  word-break: break-all;
  letter-spacing: 0.02em;
}

.url-result-box .url-display a {
  color: var(--accent-light);
  text-decoration: none;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-muted);
}

.empty-state-icon {
  font-size: 4rem; margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 8px;
}

/* ---- TABS ---- */
.tabs {
  display: flex; gap: 4px;
  background: var(--paper-alt);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 2rem;
}

.tab {
  flex: 1; padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600; font-size: 0.9rem;
  color: var(--ink-muted);
  transition: .2s;
}

.tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---- FOOTER ---- */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 4rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .navbar { padding: 0 1rem; }
  .nav-links { display: none; }
}
