/* ============================================================
   MAGNUM THEME  ·  LE → SAP Transformer
   Deep chocolate + gold, glossy premium micro-interactions
   ============================================================ */

:root {
    --black:      #0b0a09;
    --choc-900:   #141210;
    --choc-800:   #1c1815;
    --choc-700:   #262019;
    --choc-600:   #322a20;
    --gold-100:   #f7e6bd;
    --gold-300:   #e7c778;
    --gold-400:   #d4af37;
    --gold-500:   #c8a24b;
    --gold-600:   #a9843a;
    --cream:      #f4ede0;
    --muted:      #b7ab97;
    --ok:         #6fcf97;
    --err:        #e78a7f;
    --radius:     18px;
    --shadow:     0 30px 80px rgba(0, 0, 0, .55);
    --gold-grad:  linear-gradient(135deg, #f7e6bd 0%, #d4af37 45%, #a9843a 100%);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--cream);
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(212, 175, 55, .12), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(168, 132, 58, .10), transparent 60%),
        linear-gradient(160deg, #0b0a09 0%, #141210 40%, #1c1815 100%);
    overflow-x: hidden;
}

/* ---------- Ambient orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; }
.orb-1 { width: 420px; height: 420px; top: -120px; right: -80px;
         background: radial-gradient(circle, rgba(231,199,120,.6), transparent 70%);
         animation: float1 14s ease-in-out infinite; }
.orb-2 { width: 360px; height: 360px; bottom: -140px; left: -100px;
         background: radial-gradient(circle, rgba(168,132,58,.55), transparent 70%);
         animation: float2 18s ease-in-out infinite; }
.orb-3 { width: 280px; height: 280px; top: 40%; left: 60%;
         background: radial-gradient(circle, rgba(212,175,55,.35), transparent 70%);
         animation: float1 22s ease-in-out infinite reverse; }
@keyframes float1 { 0%,100% { transform: translateY(0) } 50% { transform: translateY(30px) } }
@keyframes float2 { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-40px) } }

/* ---------- Card ---------- */
.card {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    padding: 40px 40px 34px;
    background: linear-gradient(180deg, rgba(38,32,25,.92), rgba(20,18,16,.94));
    border: 1px solid rgba(212, 175, 55, .28);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.card::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, rgba(247,230,189,.5), rgba(168,132,58,.05) 40%, rgba(212,175,55,.4));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98) } to { opacity: 1; transform: none } }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand-mark {
    font-family: 'Playfair Display', serif;
    font-weight: 800;
    letter-spacing: 4px;
    font-size: 22px;
    background: var(--gold-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    text-shadow: 0 1px 0 rgba(0,0,0,.3);
}
.brand-rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212,175,55,.6), transparent); }
.brand-tag { margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

/* ---------- Headline ---------- */
.headline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--cream);
}
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 62ch; }
.nowrap { white-space: nowrap; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; color: var(--gold-300); }

/* ---------- Two-file output explainer ---------- */
.out-info { display: flex; gap: 12px; margin: 0 0 26px; flex-wrap: wrap; }
.out-pill {
    flex: 1 1 220px;
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(50,42,32,.55), rgba(28,24,21,.55));
    border: 1px solid rgba(212,175,55,.20);
    border-radius: 12px;
}
.out-icon {
    display: grid; place-items: center;
    width: 34px; height: 34px; border-radius: 9px;
    font-size: 17px; flex: none;
    background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.3);
    color: var(--gold-300);
}
.out-icon.out-arch { color: var(--gold-100); }
.out-txt { display: flex; flex-direction: column; line-height: 1.3; }
.out-txt strong { font-size: 13.5px; color: var(--cream); }
.out-txt span { font-size: 12px; color: var(--muted); }

/* ---------- Drop zone ---------- */
.drop-zone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    text-align: center;
    padding: 42px 24px;
    border: 1.5px dashed rgba(212, 175, 55, .4);
    border-radius: 14px;
    background: radial-gradient(400px 200px at 50% 0%, rgba(212,175,55,.06), transparent 70%), rgba(255,255,255,.015);
    color: var(--cream);
    cursor: pointer;
    transition: border-color .25s, background .25s, transform .25s, box-shadow .25s;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.hover {
    outline: none;
    border-color: var(--gold-400);
    background: radial-gradient(400px 220px at 50% 0%, rgba(212,175,55,.14), transparent 70%), rgba(212,175,55,.04);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(212,175,55,.12);
}
.drop-icon { color: var(--gold-400); display: grid; place-items: center;
             width: 68px; height: 68px; border-radius: 50%;
             background: rgba(212,175,55,.08); border: 1px solid rgba(212,175,55,.3); margin-bottom: 4px; }
.drop-zone.hover .drop-icon { animation: bob .8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-5px) } }
.drop-text { font-size: 16px; }
.drop-text strong { color: var(--gold-300); }
.drop-sub { font-size: 13px; color: var(--muted); }
.drop-sub u { color: var(--gold-300); text-underline-offset: 3px; }

/* ---------- File chips ---------- */
.file-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-chip {
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
    padding: 11px 14px;
    background: linear-gradient(180deg, rgba(50,42,32,.7), rgba(28,24,21,.7));
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 11px;
    animation: chipIn .35s ease both;
}
@keyframes chipIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.fc-icon { color: var(--gold-400); display: inline-flex; }
.fc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--cream); }
.fc-size { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fc-remove {
    all: unset; cursor: pointer; width: 24px; height: 24px; line-height: 1;
    display: grid; place-items: center; border-radius: 50%; font-size: 18px; color: var(--muted);
    transition: background .2s, color .2s;
}
.fc-remove:hover { background: rgba(231,138,127,.15); color: var(--err); }

/* ---------- Gold button ---------- */
.btn-gold {
    position: relative; overflow: hidden;
    width: 100%; margin-top: 22px; padding: 16px 22px;
    border: none; border-radius: 12px; cursor: pointer;
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15.5px; letter-spacing: .3px;
    color: #241c0d;
    background: var(--gold-grad);
    box-shadow: 0 12px 30px rgba(212,175,55,.28), inset 0 1px 0 rgba(255,255,255,.4);
    transition: transform .2s, box-shadow .2s, filter .2s, opacity .2s;
}
.btn-gold:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(212,175,55,.38), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-gold:active:not(:disabled) { transform: translateY(0); }
.btn-gold:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
.btn-label { position: relative; z-index: 2; }
.btn-shine {
    position: absolute; top: 0; left: -60%; width: 40%; height: 100%; z-index: 1;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
    transform: skewX(-20deg);
}
.btn-gold:hover:not(:disabled) .btn-shine { animation: shine 1s ease; }
@keyframes shine { from { left: -60% } to { left: 130% } }

/* ---------- Status ---------- */
.status { margin-top: 16px; min-height: 22px; font-size: 14px; text-align: center; transition: color .2s; }
.status.ok  { color: var(--ok); }
.status.err { color: var(--err); white-space: pre-wrap; text-align: left; }

/* ============================================================
   FULL-SCREEN LOADER
   ============================================================ */
.loader {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center;
    background: radial-gradient(600px 400px at 50% 40%, rgba(30,25,20,.85), rgba(6,5,4,.94));
    backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.loader.show { opacity: 1; visibility: visible; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }

/* Melting gold spinner: three dripping bars */
.melt-spinner { display: flex; gap: 10px; height: 56px; align-items: flex-start; }
.melt-spinner span {
    width: 12px; height: 44px; border-radius: 8px;
    background: var(--gold-grad);
    box-shadow: 0 8px 24px rgba(212,175,55,.4);
    animation: melt 1.1s ease-in-out infinite;
}
.melt-spinner span:nth-child(2) { animation-delay: .18s; }
.melt-spinner span:nth-child(3) { animation-delay: .36s; }
@keyframes melt {
    0%, 100% { transform: scaleY(1);   opacity: 1;   }
    50%      { transform: scaleY(.45); opacity: .55; }
}

.loader-text {
    margin: 0; font-family: 'Playfair Display', serif; font-size: 18px;
    color: var(--gold-100); letter-spacing: .3px;
}

.loader-bar { width: 220px; height: 4px; border-radius: 4px; background: rgba(212,175,55,.15); overflow: hidden; }
.loader-bar i {
    display: block; width: 40%; height: 100%; border-radius: 4px;
    background: var(--gold-grad);
    animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(120%);  }
    100% { transform: translateX(260%);  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Small screens ---------- */
@media (max-width: 520px) {
    .card { padding: 28px 22px 24px; }
    .drop-zone { padding: 32px 16px; }
    .file-chip { grid-template-columns: auto 1fr auto; }
    .fc-size { display: none; }
    .out-info { flex-direction: column; }
}
