/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  --navy:          #0A1628;
  --navy-mid:      #11213A;
  --navy-light:    #1A3A6B;
  --orange:        #FF6B35;
  --orange-hover:  #F55E28;
  --orange-glow:   rgba(255, 107, 53, 0.22);
  --orange-ring:   rgba(255, 107, 53, 0.28);
  --page:          #ECF0F8;
  --surface:       #FFFFFF;
  --text:          #0C1523;
  --muted:         #5B6C84;
  --line:          #D5DDEC;
  --line-hover:    #9AABC4;
  --success:       #16A34A;
  --danger:        #DC2626;
  --warning:       #D97706;
}

/* ── BASE ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
button { cursor: pointer; font-family: inherit; }
a { cursor: pointer; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  background-image:
    radial-gradient(ellipse 60% 50% at -5% -5%, rgba(255, 107, 53, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 105% 5%, rgba(26, 58, 107, 0.08) 0%, transparent 45%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(100%, 26rem);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-top: 2px solid var(--orange);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.92);
  padding: 2.25rem 2rem;
  box-shadow:
    0 28px 80px rgba(10, 22, 40, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
  backdrop-filter: blur(18px);
  animation: login-card-in 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes login-card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 420px) {
  .login-card { padding: 1.75rem 1.25rem; border-radius: 1.5rem; }
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-hover); }

/* ── SHELL ───────────────────────────────────────────────── */
.shell { min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(175deg, #0E2040 0%, var(--navy) 45%, #0B1930 100%);
  color: white;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border-radius: 0.875rem;
  padding: 0.8rem 1rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

/* orange left rail — hidden by default */
.sidebar-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
  transform: scaleY(0);
  opacity: 0;
  transition: transform 150ms ease, opacity 150ms ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.90);
  transform: translateX(2px);
}

.sidebar-link.active {
  background: rgba(255, 107, 53, 0.14);
  color: #FFFFFF;
}

.sidebar-link.active::before {
  transform: scaleY(1);
  opacity: 1;
}

.sidebar-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--orange-ring);
}

.sidebar-divider {
  height: 1px;
  margin: 1.1rem 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
}

/* ── SIDEBAR CARD (Publish / History / Logout) ──────────────── */
.sidebar-card {
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem;
}

.sidebar-card-divider {
  height: 1px;
  margin: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link--danger { color: rgba(252, 165, 165, 0.85); }

.sidebar-link--danger:hover {
  background: rgba(220, 38, 38, 0.14);
  color: #FECACA;
}

/* ── BRAND MARK ──────────────────────────────────────────── */
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  background: linear-gradient(145deg, #FF8050 0%, var(--orange) 55%, #E05520 100%);
  color: white;
  font-size: 1rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(255, 107, 53, 0.35),
    0 8px 22px rgba(255, 107, 53, 0.30);
}

.brand-mark--logo {
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #F8F8F8;
  box-shadow:
    0 0 0 1px rgba(255, 107, 53, 0.22),
    0 8px 22px rgba(10, 22, 40, 0.28);
}

.brand-mark--logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark--login {
  width: 5rem;
  height: 5rem;
  border-width: 3px;
  border-radius: 1.4rem;
  box-shadow:
    0 0 0 1px rgba(255, 107, 53, 0.20),
    0 14px 34px rgba(10, 22, 40, 0.18);
}

/* ── GLASS PANEL ─────────────────────────────────────────── */
.glass-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 20px 52px rgba(10, 22, 40, 0.09),
    0 2px 8px rgba(10, 22, 40, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* orange top accent on the main content panels */
main .glass-panel {
  border-top: 2.5px solid var(--orange);
}

/* ── CONTROL CARD ────────────────────────────────────────── */
.control-card {
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(10, 22, 40, 0.05);
  overflow: hidden;
}

.control-card summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.control-card summary::-webkit-details-marker { display: none; }

/* ── FORM FIELDS ─────────────────────────────────────────── */
.field-row {
  display: grid;
  gap: 0.4rem;
  padding-block: 0.45rem;
}

.field-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 0.75rem;
  background: #F7FAFF;
  padding: 0.68rem 0.875rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.field-input:hover {
  border-color: var(--line-hover);
  background: #FFFFFF;
}

.field-input:focus {
  border-color: var(--orange);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px var(--orange-ring);
}

/* ── FIELD ICONS / PASSWORD TOGGLE ───────────────────────── */
.field-input-group { position: relative; }

.field-input-icon-left {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--muted);
  pointer-events: none;
}

.field-input-group.has-icon-left .field-input { padding-left: 2.6rem; }
.field-input-group.has-icon-right .field-input { padding-right: 2.6rem; }

.field-toggle-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--muted);
  transition: background 140ms ease, color 140ms ease;
}

.field-toggle-btn:hover { background: rgba(10, 22, 40, 0.06); color: var(--text); }

.field-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--orange-ring);
}

/* ── PRIMARY BUTTON ──────────────────────────────────────── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 0.875rem;
  background: linear-gradient(155deg, #FF8050 0%, var(--orange) 55%, #E85C22 100%);
  color: white;
  padding: 0.78rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.20) inset,
    0 8px 20px rgba(255, 107, 53, 0.30);
  transition:
    transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 140ms ease,
    filter 140ms ease;
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.20) inset,
    0 14px 34px rgba(255, 107, 53, 0.42);
}

.primary-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.975);
  filter: brightness(0.97);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.20) inset,
    0 3px 8px rgba(255, 107, 53, 0.22);
  transition-duration: 55ms;
}

.primary-btn:focus-visible {
  outline: none;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.20) inset,
    0 0 0 3px var(--orange-ring);
}

/* ── SECONDARY BUTTON ────────────────────────────────────── */
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1.5px solid var(--line);
  border-radius: 0.875rem;
  background: white;
  color: var(--text);
  padding: 0.78rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 4px rgba(10, 22, 40, 0.06);
  transition:
    transform 140ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.secondary-btn:hover:not(:disabled) {
  border-color: var(--line-hover);
  background: #F4F8FF;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(10, 22, 40, 0.10);
}

.secondary-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.975);
  background: #EBF1FB;
  box-shadow: 0 1px 3px rgba(10, 22, 40, 0.06);
  transition-duration: 55ms;
}

.secondary-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--orange-ring);
}

/* disabled state */
.primary-btn:disabled,
.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* ── RELEASE CARDS ───────────────────────────────────────── */
#releaseList article {
  transition: transform 180ms ease, box-shadow 180ms ease;
}

#releaseList article:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(10, 22, 40, 0.11);
}

/* status-specific left accent */
#releaseList .release-card--published    { border-left: 3px solid var(--success); }
#releaseList .release-card--uploaded     { border-left: 3px solid #3B82F6; }
#releaseList .release-card--syncing      { border-left: 3px solid #F59E0B; }
#releaseList .release-card--sync_failed  { border-left: 3px solid #DC2626; }
#releaseList .release-card--archived     { border-left: 3px solid #94A3B8; }

/* ── UPLOAD PROGRESS ─────────────────────────────────────── */
.upload-progress-panel {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  align-items: center;
  border-radius: 1.25rem;
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-mid) 100%);
  border: 1px solid rgba(255, 107, 53, 0.20);
  padding: 1.2rem;
  box-shadow: 0 16px 40px rgba(10, 22, 40, 0.20);
}

.upload-progress-panel.hidden { display: none; }

.upload-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: white;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 900;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.upload-cancel-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
}

.upload-cancel-btn.hidden { display: none; }

.upload-progress-ring {
  --progress: 0;
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--orange) calc(var(--progress) * 1%),
    rgba(255, 255, 255, 0.10) 0
  );
  transition: background 140ms linear;
}

.upload-progress-ring.is-busy {
  animation: ring-pulse 1.2s ease-in-out infinite;
}

.upload-progress-ring-inner {
  display: grid;
  width: 3.8rem;
  height: 3.8rem;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

/* ── ENDPOINT PILL ───────────────────────────────────────── */
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  background: rgba(10, 22, 40, 0.06);
  border: 1px solid rgba(10, 22, 40, 0.08);
  color: var(--navy-light);
  padding: 0.3rem 0.7rem;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 100;
  transform: translateY(0.5rem) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* ── MISC COMPONENTS ─────────────────────────────────────── */
.preview-chip {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  padding: 0.5rem;
}

.color-picker-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.7rem;
  align-items: center;
}

.color-picker-row input[type="color"] {
  width: 3.2rem;
  height: 2.75rem;
  padding: 0.18rem;
  border: 1.5px solid var(--line);
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
}

.color-value {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 0.75rem;
  background: #F8FAFC;
  padding-inline: 0.875rem;
  color: #334155;
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 800;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.42rem;
}

.swatch-btn {
  min-height: 1.85rem;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 0.625rem;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.10), 0 3px 8px rgba(15, 23, 42, 0.08);
  transition: transform 110ms ease, box-shadow 110ms ease;
}

.swatch-btn:hover  { transform: scale(1.12); }
.swatch-btn.active { box-shadow: 0 0 0 2px var(--orange), 0 6px 16px var(--orange-glow); }

.range-row {
  display: grid;
  grid-template-columns: 1fr 3.75rem;
  gap: 0.75rem;
  align-items: center;
}

.range-value {
  border-radius: 99px;
  background: #F1F5F9;
  color: var(--text);
  padding: 0.38rem 0.65rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.8rem;
}

/* phone frame (unused on this page but kept for other pages) */
.phone-frame {
  width: min(100%, 390px);
  margin-inline: auto;
  border-radius: 2.25rem;
  padding: 0.65rem;
  background: linear-gradient(180deg, #202B3D, #050B14);
  box-shadow: 0 30px 70px rgba(10, 22, 40, 0.28);
}

.phone-screen {
  min-height: 760px;
  overflow: hidden;
  border-radius: 1.75rem;
  background: #FAFAFA;
  position: relative;
}

.phone-notch {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  width: 6.5rem;
  height: 1.35rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050B14;
  z-index: 10;
}

/* ── RESPONSIVE SIDEBAR ──────────────────────────────────── */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 24px 0 64px rgba(10, 22, 40, 0.30);
  }
}

/* ── REDUCED MOTION ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
