/* ==========================================================================
   Maria-Petre — Atelier foto
   Paleta: noir #111015 · panou #1a1922 · fildes #f0ebe0 · auriu #de9b35
   Tipografie: Cormorant Garamond (titluri) · Jost (interfata)
   ========================================================================== */

:root {
    --noir: #111015;
    --noir-2: #16151c;
    --panel: #1a1922;
    --panel-2: #201f29;
    --ivory: #f0ebe0;
    --muted: #938e80;
    --gold: #de9b35;
    --gold-soft: rgba(222, 155, 53, 0.16);
    --gold-line: rgba(222, 155, 53, 0.28);
    --line: rgba(240, 235, 224, 0.08);
    --danger: #d96a5a;
    --radius: 14px;
    --font-ui: 'Jost', system-ui, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, serif;
}

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

html, body { height: 100%; }

body {
    background:
        radial-gradient(1100px 500px at 75% -10%, rgba(222, 155, 53, 0.07), transparent 60%),
        var(--noir);
    color: var(--ivory);
    font-family: var(--font-ui);
    font-weight: 300;
    font-size: 15px;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Butoane si controale comune
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--ivory);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.btn:hover { border-color: var(--gold-line); }
.btn:active { transform: translateY(1px); }

.btn-gold {
    background: linear-gradient(160deg, #ecb35a, var(--gold) 55%, #b87a20);
    border-color: transparent;
    color: #1c1508;
    font-weight: 600;
}
.btn-gold:hover { filter: brightness(1.07); }

.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-big { padding: 14px 18px; font-size: 16px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s ease;
}
.chip:hover { color: var(--ivory); border-color: var(--gold-line); }
.chip.is-on {
    color: #1c1508;
    background: var(--gold);
    border-color: var(--gold);
    font-weight: 500;
}

/* Slidere */
.slider-field { display: block; margin: 18px 0; }
.slider-field > span {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    margin-bottom: 8px;
}
.slider-field b {
    font-weight: 500;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.slider-field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.45;
}
input[type="range"] {
    width: 100%;
    height: 26px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-line), var(--line));
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #2a2415;
    box-shadow: 0 0 0 3px rgba(222, 155, 53, 0.18);
}
input[type="range"]::-moz-range-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--gold-line), var(--line));
}
input[type="range"]::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #2a2415;
}

/* Switch */
.field-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 14px 0;
    font-size: 14px;
}
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
    position: absolute; inset: 0;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: background .18s ease;
}
.switch i::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform .18s ease, background .18s ease;
}
.switch input:checked + i { background: var(--gold-soft); border-color: var(--gold-line); }
.switch input:checked + i::after { transform: translateX(20px); background: var(--gold); }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-scene {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(400px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 42px 36px 36px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.login-logo {
    width: 220px;
    margin: 0 auto 4px;
    filter: brightness(0) invert(0.94);
}
.login-sub {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
    color: var(--gold);
    margin-bottom: 28px;
}
.field { display: block; text-align: left; margin-bottom: 16px; }
.field span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 8px;
}
.field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: inherit;
    font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--gold-line); }
.login-error { color: var(--danger); font-size: 13.5px; margin: -6px 0 14px; }

/* --------------------------------------------------------------------------
   Structura aplicatiei
   -------------------------------------------------------------------------- */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(17, 16, 21, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand {
    height: 52px;
    width: auto;
    filter: brightness(0) invert(0.94);
}
.topbar-actions { display: flex; gap: 8px; }

.workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 216px 1fr 340px;
    gap: 0;
    min-height: 0;
}

/* --------------------------------------------------------------------------
   Firul pasilor (semnatura vizuala)
   -------------------------------------------------------------------------- */

.rail {
    position: relative;
    border-right: 1px solid var(--line);
    padding: 26px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rail-thread {
    position: absolute;
    left: 31px;
    top: 44px;
    width: 1px;
    background: linear-gradient(180deg, var(--gold), rgba(222, 155, 53, 0.06));
    transition: height .35s ease;
    height: 0;
}
.rail-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13.5px;
    letter-spacing: 0.02em;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.rail-step:hover { color: var(--ivory); background: rgba(240, 235, 224, 0.03); }
.rail-step i {
    flex: 0 0 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--noir);
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 600;
    font-size: 14px;
    z-index: 1;
    transition: all .15s ease;
}
.rail-step.is-active { color: var(--ivory); }
.rail-step.is-active i {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-soft);
}
.rail-step.is-done i {
    background: var(--gold);
    border-color: var(--gold);
    color: #1c1508;
}

/* --------------------------------------------------------------------------
   Scena (canvas)
   -------------------------------------------------------------------------- */

.stage {
    display: grid;
    place-items: center;
    padding: 28px;
    min-height: 420px;
    background:
        radial-gradient(700px 400px at 50% 30%, rgba(240, 235, 224, 0.025), transparent 70%);
}
.stage-empty {
    text-align: center;
    color: var(--muted);
    max-width: 380px;
    line-height: 1.6;
}
.stage-empty-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 26px;
    color: var(--ivory);
    margin-bottom: 10px;
}
.stage-canvas-wrap {
    position: relative;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    border-radius: 4px;
}
#viewCanvas {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 180px);
    border-radius: 4px;
}

/* Decupare */
.crop-layer { position: absolute; inset: 0; }
.crop-box {
    position: absolute;
    border: 1.5px solid var(--gold);
    box-shadow: 0 0 0 9999px rgba(10, 9, 12, 0.62);
    cursor: move;
    touch-action: none;
}
.crop-box::before, .crop-box::after {
    content: "";
    position: absolute;
    background: rgba(222, 155, 53, 0.35);
    pointer-events: none;
}
.crop-box::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left: 1px solid rgba(222,155,53,.3); border-right: 1px solid rgba(222,155,53,.3); background: none; }
.crop-box::after  { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top: 1px solid rgba(222,155,53,.3); border-bottom: 1px solid rgba(222,155,53,.3); background: none; }
.crop-handle {
    position: absolute;
    width: 16px; height: 16px;
    background: var(--gold);
    border-radius: 50%;
    border: 2px solid #1c1508;
    touch-action: none;
}
.crop-handle[data-h="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }
.crop-handle[data-h="n"]  { top: -8px; left: calc(50% - 8px); cursor: ns-resize; }
.crop-handle[data-h="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.crop-handle[data-h="e"]  { top: calc(50% - 8px); right: -8px; cursor: ew-resize; }
.crop-handle[data-h="se"] { bottom: -8px; right: -8px; cursor: nwse-resize; }
.crop-handle[data-h="s"]  { bottom: -8px; left: calc(50% - 8px); cursor: ns-resize; }
.crop-handle[data-h="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.crop-handle[data-h="w"]  { top: calc(50% - 8px); left: -8px; cursor: ew-resize; }

/* --------------------------------------------------------------------------
   Panoul pasilor
   -------------------------------------------------------------------------- */

.panel {
    border-left: 1px solid var(--line);
    background: var(--panel);
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.step-panel { display: none; animation: panelIn .25s ease; }
.step-panel.is-active { display: block; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.step-title {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    margin-bottom: 4px;
}
.step-title em {
    display: block;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 30px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ivory);
    margin-top: 2px;
}
.step-help {
    color: #c8c2b4;
    font-size: 14px;
    line-height: 1.6;
    margin: 14px 0;
}
.step-help-dim { color: var(--muted); font-size: 12.5px; }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 44px 20px;
    margin: 18px 0;
    border: 1.5px dashed var(--gold-line);
    border-radius: var(--radius);
    background: var(--gold-soft);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--gold); background: rgba(222, 155, 53, 0.22); }
.dropzone input { display: none; }
.dropzone strong { font-size: 16px; font-weight: 500; }
.dropzone span { color: var(--muted); font-size: 13px; }

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 14px 0;
}
.preset {
    padding: 14px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--ivory);
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    transition: all .15s ease;
}
.preset:hover { border-color: var(--gold-line); }
.preset.is-on {
    border-color: var(--gold);
    background: var(--gold-soft);
    color: var(--gold);
}

.panel-nav {
    margin-top: auto;
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.export-result {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
    background: var(--gold-soft);
}
.export-result p { margin-bottom: 10px; font-size: 14px; }

/* --------------------------------------------------------------------------
   Asistent
   -------------------------------------------------------------------------- */

.assistant-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 30;
    padding: 12px 20px;
    border-radius: 999px;
    border: 1px solid var(--gold-line);
    background: var(--panel);
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
    transition: transform .15s ease, background .15s ease;
}
.assistant-fab:hover { transform: translateY(-2px); background: var(--panel-2); }

.assistant {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    width: min(380px, calc(100vw - 32px));
    height: min(480px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--gold-line);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.assistant-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    color: var(--gold);
}
.assistant-close {
    border: 0; background: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.assistant-close:hover { color: var(--ivory); }
.assistant-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
}
.msg-ai {
    align-self: flex-start;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}
.msg-user {
    align-self: flex-end;
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    border-bottom-right-radius: 4px;
}
.msg-wait { color: var(--muted); font-style: italic; }
.assistant-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}
.assistant-form input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: inherit;
    font-size: 14px;
}
.assistant-form input:focus { outline: none; border-color: var(--gold-line); }

/* --------------------------------------------------------------------------
   Toast si loader
   -------------------------------------------------------------------------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 60;
    padding: 12px 22px;
    background: var(--panel-2);
    border: 1px solid var(--gold-line);
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    animation: panelIn .2s ease;
}
.toast.is-error { border-color: var(--danger); color: #f2b3a9; }

.busy {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    place-content: center;
    gap: 16px;
    background: rgba(12, 11, 15, 0.78);
    backdrop-filter: blur(4px);
}
.busy p { color: var(--ivory); font-size: 15px; }
.busy-ring {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 3px solid var(--gold-soft);
    border-top-color: var(--gold);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .workspace { grid-template-columns: 190px 1fr 300px; }
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    .rail {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
        gap: 2px;
    }
    .rail-thread { display: none; }
    .rail-step { flex: 0 0 auto; padding: 8px 10px; }
    .rail-step span { display: none; }
    .rail-step.is-active span { display: inline; }
    .stage { min-height: 300px; padding: 16px; }
    .stage-canvas-wrap, #viewCanvas { max-height: 52vh; }
    .panel { border-left: 0; border-top: 1px solid var(--line); }
    .brand { height: 42px; }
    .topbar { padding: 8px 14px; }
    #btnCompare { display: none; }
}

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

/* ==========================================================================
   ADMINISTRARE PORTOFOLIU
   ========================================================================== */

.topnav { display: flex; gap: 4px; margin-left: 18px; margin-right: auto; }
.topnav-link {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.03em;
    transition: color .15s ease, background .15s ease;
}
.topnav-link:hover { color: var(--ivory); }
.topnav-link.is-on { color: var(--gold); background: var(--gold-soft); }

.admin-main {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 30px 22px 60px;
}
.admin-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 34px;
}
.admin-head { margin-bottom: 20px; }
.crumbs { margin-bottom: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.crumbs a:hover { color: var(--gold); }
.flash { color: var(--danger); margin-bottom: 12px; }

.notice-card {
    background: var(--panel);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
    padding: 26px;
    margin: 18px 0;
    line-height: 1.65;
}
.notice-card h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--gold);
}
.notice-card ol { margin: 12px 0 12px 20px; }
.notice-card li { margin: 6px 0; }
.notice-card code {
    background: var(--noir-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 13px;
}

.album-create {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 26px;
}
.album-create input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: inherit;
    font-size: 14.5px;
}
.album-create input[type="text"]:focus { outline: none; border-color: var(--gold-line); }
.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}
.check input { accent-color: var(--gold); width: 16px; height: 16px; }

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.album-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s ease, transform .15s ease;
}
.album-card:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.album-cover {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--noir-2);
    overflow: hidden;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-empty {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--muted);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
}
.album-meta { padding: 12px 14px 4px; }
.album-name {
    display: block;
    color: var(--ivory);
    text-decoration: none;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 19px;
}
.album-name:hover { color: var(--gold); }
.album-sub { color: var(--muted); font-size: 12.5px; }
.tag-pub { color: var(--gold); font-weight: 500; }
.tag-priv { color: var(--muted); font-weight: 500; }
.album-actions {
    display: flex;
    gap: 6px;
    padding: 10px 12px 12px;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger:hover { border-color: var(--danger); color: #f2b3a9; }

.album-edit { display: grid; gap: 10px; margin-bottom: 6px; }
.album-title-input {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 30px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ivory);
    width: 100%;
}
.album-title-input:hover { border-color: var(--line); }
.album-title-input:focus { outline: none; border-color: var(--gold-line); background: var(--noir-2); }
.album-edit textarea {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}
.album-edit textarea:focus { outline: none; border-color: var(--gold-line); }
.album-edit .btn-row { margin: 0; }
.album-toolbar { margin: 6px 0 16px; }

.dropzone-slim { padding: 24px 20px; margin: 10px 0 6px; }

.upload-progress {
    margin: 8px 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--gold-line);
    border-radius: 10px;
    background: var(--gold-soft);
    font-size: 13.5px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.photo-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.photo-card > a { display: block; aspect-ratio: 1 / 1; background: var(--noir-2); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }
.tag-edit, .tag-cover {
    position: absolute;
    top: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.05em;
    backdrop-filter: blur(4px);
}
.tag-edit { left: 8px; background: rgba(20, 19, 26, 0.75); color: var(--gold); border: 1px solid var(--gold-line); }
.tag-cover { right: 8px; background: var(--gold); color: #1c1508; font-weight: 600; }
.photo-actions {
    display: flex;
    gap: 5px;
    padding: 8px;
    flex-wrap: wrap;
}

.field select {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: inherit;
    font-size: 14.5px;
}
.field select:focus { outline: none; border-color: var(--gold-line); }

/* ==========================================================================
   SITE PUBLIC — PORTOFOLIU
   ========================================================================== */

.public-body { display: flex; flex-direction: column; min-height: 100vh; }

.pub-header {
    text-align: center;
    padding: 46px 20px 26px;
}
.pub-logo {
    height: 88px;
    width: auto;
    margin: 0 auto;
    filter: brightness(0) invert(0.94);
}
.pub-tagline {
    margin-top: 8px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
    color: var(--gold);
}

.pub-main {
    flex: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 10px 22px 70px;
}
.pub-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 38px;
    margin-bottom: 8px;
}
.pub-title-home { text-align: center; margin-bottom: 26px; }
.pub-desc { color: #c8c2b4; line-height: 1.65; max-width: 640px; margin-bottom: 22px; }
.pub-empty { color: var(--muted); font-style: italic; padding: 40px 0; }
.pub-hero { text-align: center; padding: 70px 0; }
.pub-hero .pub-desc { margin: 0 auto; }

.pub-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}
.pub-album {
    display: block;
    text-decoration: none;
    color: var(--ivory);
}
.pub-album-img {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    transition: border-color .18s ease;
}
.pub-album-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.pub-album:hover .pub-album-img { border-color: var(--gold-line); }
.pub-album:hover .pub-album-img img { transform: scale(1.04); }
.pub-album-name {
    display: block;
    margin-top: 12px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 22px;
}
.pub-album:hover .pub-album-name { color: var(--gold); }
.pub-album-sub { color: var(--muted); font-size: 13px; }

.pub-grid {
    columns: 3 300px;
    column-gap: 14px;
}
.pub-item {
    display: block;
    margin-bottom: 14px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    break-inside: avoid;
    transition: border-color .15s ease;
}
.pub-item:hover { border-color: var(--gold-line); }
.pub-item img { width: 100%; display: block; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    background: rgba(10, 9, 12, 0.94);
    backdrop-filter: blur(6px);
}
.lightbox img {
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 6px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}
.lightbox-close {
    position: absolute;
    top: 14px; right: 18px;
    border: 0; background: none;
    color: var(--ivory);
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}
.lightbox-close:hover { color: var(--gold); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--line);
    background: rgba(26, 25, 34, 0.6);
    color: var(--ivory);
    width: 46px; height: 46px;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: border-color .15s ease, color .15s ease;
}
.lightbox-nav:hover { border-color: var(--gold); color: var(--gold); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.pub-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 26px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.pub-admin-link { color: var(--muted); text-decoration: none; }
.pub-admin-link:hover { color: var(--gold); }

@media (max-width: 900px) {
    .topnav { margin-left: 8px; }
    .topnav-link { padding: 7px 10px; font-size: 13px; }
    .pub-logo { height: 66px; }
    .pub-title { font-size: 30px; }
    .pub-grid { columns: 2 160px; }
    .admin-main { padding: 20px 14px 50px; }
    .album-title-input { font-size: 24px; }
    #btnAutoAI { padding: 8px 12px; font-size: 13px; }
}

/* Atributul hidden invinge orice display din clase */
[hidden] { display: none !important; }

/* ==========================================================================
   POEZII (admin + public) · DISTRIBUIRE · RESPONSIVE v2
   ========================================================================== */

.pub-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}
.pub-nav-link {
    padding: 9px 22px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all .15s ease;
}
.pub-nav-link:hover { color: var(--ivory); border-color: var(--gold-line); }
.pub-nav-link.is-on { color: var(--gold); border-color: var(--gold); background: var(--gold-soft); }

/* Poezii — admin */
.poem-form {
    display: grid;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 26px;
}
.poem-title-input {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 24px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    width: 100%;
}
.poem-title-input:focus { outline: none; border-color: var(--gold-line); }
.poem-form textarea {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.7;
    resize: vertical;
}
.poem-form textarea:focus { outline: none; border-color: var(--gold-line); }
.poem-form .btn-row { margin: 0; align-items: center; }

.poem-list { display: grid; gap: 12px; }
.poem-card {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    flex-wrap: wrap;
}
.poem-card h3 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 21px;
}
.poem-card-main { flex: 1; min-width: 220px; }
.poem-preview { color: var(--muted); font-size: 13.5px; margin-top: 6px; white-space: pre-line; }

/* Poezii — public */
.poem-pub-list {
    display: grid;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
}
.poem-pub-card {
    display: block;
    text-decoration: none;
    color: var(--ivory);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px;
    transition: border-color .15s ease, transform .15s ease;
}
.poem-pub-card:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.poem-pub-card h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 600;
    font-size: 26px;
}
.poem-pub-card h2:hover { color: var(--gold); }
.poem-pub-card p { color: #c8c2b4; margin-top: 8px; white-space: pre-line; line-height: 1.6; font-family: var(--font-display); font-size: 16px; }
.poem-date { color: var(--muted); font-size: 12.5px; letter-spacing: 0.06em; }

.poem-page { max-width: 680px; margin: 0 auto; }
.poem-body {
    margin-top: 22px;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1.9;
    color: #e8e2d4;
    white-space: pre-line;
}

/* Distribuire */
.btn-share, .lightbox-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1px solid var(--gold-line);
    background: var(--gold-soft);
    color: var(--gold);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-share { margin-top: 26px; }
.btn-share:hover, .lightbox-share:hover { background: var(--gold); color: #1c1508; }
.lightbox-share {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    backdrop-filter: blur(6px);
}

/* Chips retele sociale */
.social-label { margin-bottom: 4px; }
.chip-social { border-color: var(--gold-line); color: #d8b273; }
.chip-social.is-on { background: var(--gold); color: #1c1508; border-color: var(--gold); }

/* ==========================================================================
   RESPONSIVE v2 — telefon
   ========================================================================== */

@media (max-width: 900px) {
    /* Topbar compact, pe un singur rand care incape */
    .topbar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
    .brand { height: 34px; }
    .topnav { margin: 0; order: 3; width: 100%; justify-content: space-around; }
    .topnav-link { padding: 7px 8px; font-size: 13px; }
    .topbar-actions { margin-left: auto; gap: 6px; }
    .topbar-actions .btn { padding: 7px 10px; font-size: 12.5px; }

    /* Scena nu mai ocupa jumatate de ecran cand e goala */
    .stage { min-height: 0; padding: 14px; }
    .stage-empty { padding: 18px 8px; }
    .stage-empty-title { font-size: 21px; }
    .stage-empty p:not(.stage-empty-title) { font-size: 13.5px; }

    /* Panoul are loc sub el pentru butonul asistentului */
    .panel { padding: 20px 16px 96px; }
    .step-title em { font-size: 25px; }
    .dropzone { padding: 30px 14px; }

    .assistant-fab { right: 14px; bottom: 14px; padding: 11px 16px; font-size: 13px; }
    .assistant { right: 10px; bottom: 10px; width: calc(100vw - 20px); height: min(460px, calc(100vh - 80px)); }

    /* Public */
    .pub-header { padding: 30px 16px 18px; }
    .pub-nav-link { padding: 8px 16px; font-size: 12.5px; }
    .pub-main { padding: 8px 14px 50px; }
    .poem-body { font-size: 18px; }
    .lightbox-share { bottom: 14px; }
    .lightbox-nav { width: 40px; height: 40px; }

    /* Admin */
    .album-create { flex-direction: column; align-items: stretch; }
    .album-create .btn { width: 100%; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .poem-card { flex-direction: column; }
}

@media (max-width: 480px) {
    .preset-grid { grid-template-columns: repeat(2, 1fr); }
    .preset { font-size: 15px; padding: 12px 8px; }
    .chip { padding: 7px 11px; font-size: 12.5px; }
    .panel-nav { flex-direction: column-reverse; }
    .panel-nav .btn { width: 100%; }
    .pub-grid { columns: 2 140px; column-gap: 10px; }
    .pub-item { margin-bottom: 10px; }
}

/* Fab-ul asistentului nu mai calca butoanele de navigare pe telefon */
@media (max-width: 900px) {
    .panel { padding-bottom: 130px; }
    .admin-main { padding-bottom: 100px; }
    #btnAutoAI { font-size: 12px; padding: 7px 9px; }
}

/* Retus AI */
.retouch-text {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--noir-2);
    color: var(--ivory);
    font-family: var(--font-ui);
    font-size: 14px;
    resize: vertical;
}
.retouch-text:focus { outline: none; border-color: var(--gold-line); }
