﻿:root {
  --bg: #f6f3ec;
  --card: rgba(255, 255, 255, 0.72);
  --text: #1e1d1a;
  --muted: #5f5b55;
  --accent: #0f766e;
  --accent-2: #ef6c3d;
  --ring: rgba(15, 118, 110, 0.25);
  --border: rgba(30, 29, 26, 0.12);
  --shadow: 0 16px 48px rgba(26, 22, 18, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, #ffd8af 0%, transparent 42%),
    radial-gradient(circle at 82% 82%, #8ee4db 0%, transparent 38%),
    linear-gradient(145deg, #f4efe4 0%, #ece7de 100%);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
  padding-right: var(--scrollbar-width, 0px);
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(22px);
  pointer-events: none;
  z-index: 0;
  animation: drift 10s ease-in-out infinite;
  will-change: transform;
}

.orb-a {
  width: 210px;
  height: 210px;
  background: rgba(239, 108, 61, 0.22);
  top: -44px;
  right: 6vw;
}

.orb-b {
  width: 260px;
  height: 260px;
  background: rgba(15, 118, 110, 0.2);
  left: -90px;
  bottom: 10vh;
  animation-delay: -2.2s;
}

.app-shell {
  width: min(980px, 92vw);
  margin: 36px auto 42px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

body.modal-open .app-shell {
  animation: modal-dim 0.2s ease forwards;
  pointer-events: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(244, 239, 228, 0);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.auth-gate.visible {
  display: grid;
  animation: modal-in 0.25s ease forwards;
  pointer-events: auto;
}

.auth-card {
  width: min(480px, 92vw);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
  opacity: 0;
  transform: scale(0.96) translateY(-12px);
  pointer-events: auto;
  will-change: transform, opacity;
}

.auth-gate.visible .auth-card {
  animation: card-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.1s;
}

.auth-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

#authInput,
#authSubmit {
  pointer-events: auto;
}

#authMessage {
  margin-top: 2px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
  padding: 22px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise-in 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1,
h2 {
  margin: 0;
  font-family: "Outfit", "Segoe UI", sans-serif;
}

h1 {
  margin-top: 8px;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
}

.hub-head,
.panel-head {
  display: grid;
  gap: 4px;
}

.tool-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tool-tile {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 249, 0.75));
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-tile:hover {
  transform: translateY(-1px);
}

.tool-tile.active {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
  background: linear-gradient(155deg, rgba(240, 255, 252, 0.95), rgba(225, 247, 243, 0.8));
}

.tile-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.tile-sub {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.tool-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.tool-panel.active {
  display: block;
  animation: panel-in 0.35s ease forwards;
}

.placeholder-box {
  margin-top: 14px;
  border: 1px dashed rgba(30, 29, 26, 0.2);
  border-radius: 14px;
  min-height: 132px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 244, 236, 0.6));
}

.placeholder-box p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.subtitle,
.queue-tip {
  margin: 10px 0 0;
  color: var(--muted);
}

.drop-zone {
  border: 2px dashed rgba(15, 118, 110, 0.42);
  border-radius: 18px;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(242, 250, 249, 0.65));
}

.drop-zone.drag-over {
  transform: scale(1.01);
  border-color: var(--accent-2);
  background: linear-gradient(145deg, rgba(255, 248, 242, 0.9), rgba(255, 235, 222, 0.8));
}

.drop-zone:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.drop-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.2rem;
}

.drop-sub {
  margin: 6px 0 0;
  color: var(--muted);
}

#fileInput {
  display: none;
}

.controls {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
}

.convert-btn {
  margin-top: 14px;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(130deg, var(--accent) 0%, #2ca89f 65%, #66cfc7 100%);
  color: #f8fffd;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.2s ease;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.35);
}

.convert-btn:hover:enabled {
  transform: translateY(-1px);
}

.convert-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.progress-wrap {
  margin-top: 14px;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(30, 29, 26, 0.1);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), #ff8f63);
  transition: width 0.24s ease;
}

.status {
  margin: 8px 0 0;
  color: var(--muted);
  min-height: 1.4em;
}

.file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(30, 29, 26, 0.14);
}

.meta {
  min-width: 0;
}

.name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.order-btns {
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes panel-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-dim {
  to {
    opacity: 0.65;
  }
}

@keyframes modal-in {
  to {
    background: rgba(244, 239, 228, 0.62);
  }
}

@keyframes card-pop {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(96vw, 980px);
    margin-top: 18px;
    margin-bottom: 24px;
  }

  .card {
    border-radius: 18px;
    padding: 16px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .file-item {
    grid-template-columns: 48px 1fr auto;
    padding: 8px;
  }

  .thumb {
    width: 48px;
    height: 48px;
  }
}

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