/* ═══════════════════════════════════════════════════════════
   setup.css — styles for setup.php wizard
   ═══════════════════════════════════════════════════════════ */

/* ─── Login page ──────────────────────────────────────────── */
body.setup-login-page {
    padding: 24px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}
.login-card {
    background: rgba(8,15,31,.82);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--accent,#3b82f6), var(--accent-2,#6366f1));
    border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem;
}
.login-card h1 { margin: 0 0 4px; font-size: 1.4rem; }
.login-card .sub { font-size: .88rem; color: var(--text-3); margin: 0 0 24px; }

/* ─── Layout ─────────────────────────────────────────────── */
body {
    padding: 0;
    margin: 0;
    min-height: 100vh;
}
.setup-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.setup-sidebar {
    background: rgba(6,12,24,.92);
    border-right: 1px solid rgba(255,255,255,.07);
    padding: 28px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 0 22px 24px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: 16px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sidebar-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent,#3b82f6), #6366f1);
    border-radius: 8px; display: flex; align-items: center;
    justify-content: center; font-size: 1rem; flex-shrink: 0;
}
.sidebar-title { font-weight: 700; font-size: .95rem; }
.sidebar-sub { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.sidebar-user {
    font-size: .78rem; color: var(--text-3);
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-user a { color: var(--text-3); text-decoration: underline; }
.sidebar-user a:hover { color: var(--text-1); }

.nav-steps { padding: 0 12px; flex: 1; }
.nav-step {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px; border-radius: 10px;
    cursor: pointer; transition: background .15s;
    text-decoration: none; color: inherit;
    margin-bottom: 2px;
}
.nav-step:hover { background: rgba(255,255,255,.05); }
.nav-step.active { background: rgba(59,130,246,.12); }
.step-num {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
    flex-shrink: 0; color: var(--text-3);
    transition: all .2s;
}
.nav-step.active .step-num {
    background: var(--accent, #3b82f6);
    border-color: var(--accent, #3b82f6);
    color: #fff;
}
.step-label { font-size: .82rem; line-height: 1.35; }
.step-label strong { display: block; font-weight: 600; color: var(--text-1); font-size: .83rem; }
.step-label span { color: var(--text-3); font-size: .76rem; }

/* ─── Main content ────────────────────────────────────────── */
.setup-main {
    padding: 32px;
    max-width: 900px;
}
.page-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.page-header h1 { margin: 0 0 4px; font-size: 1.6rem; }
.page-header p { margin: 0; color: var(--text-3); font-size: .9rem; }

/* ─── Cards ───────────────────────────────────────────────── */
.setup-card {
    background: rgba(8,15,31,.72);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.card-header {
    display: flex; align-items: flex-start; gap: 14px;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.card-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
    background: rgba(255,255,255,.06);
}
.card-header-text h2 { margin: 0 0 3px; font-size: 1.05rem; }
.card-header-text p { margin: 0; font-size: .83rem; color: var(--text-3); line-height: 1.5; }

/* ─── Form elements ───────────────────────────────────────── */
.field { margin-bottom: 0; }
.field label {
    display: flex; align-items: center; gap: 6px;
    font-size: .78rem; font-weight: 600;
    margin-bottom: 7px; color: var(--text-2);
    text-transform: uppercase; letter-spacing: .03em;
}
.field label .hint-icon { font-size: .85rem; color: var(--text-3); cursor: help; }
.field input,
.field select,
.field textarea {
    width: 100%; padding: 10px 13px;
    border-radius: 9px; border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04); color: var(--text-1);
    font-size: .9rem; transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    /* Force dark background on all browsers — prevents white flash on selects */
    -webkit-appearance: none;
    appearance: none;
}
.field select {
    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='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59,130,246,.13);
}
.field textarea {
    min-height: 180px;
    resize: vertical;
    font-family: var(--mono, monospace);
    font-size: .82rem;
    line-height: 1.55;
    -webkit-appearance: auto; /* restore resize handle */
    appearance: auto;
}
.field .field-hint { font-size: .78rem; color: var(--text-3); margin-top: 5px; line-height: 1.4; }

/* Style native <option> elements inside themed selects */
.field select option {
    background: #0f172a;
    color: var(--text-1, #e2e8f0);
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-full { grid-column: 1 / -1; }

/* ─── Shared field styles (login + wizard) ────────────────── */
.field { margin-bottom: 0; }
.msg {
    padding: 13px 16px; border-radius: 12px;
    margin-bottom: 20px; font-size: .9rem;
    display: flex; align-items: center; gap: 10px;
}
.msg.ok  { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }
.msg.err { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }

/* Login-specific msg overrides (slightly different shade) */
.login-card .msg.ok  { color: #4ade80; }
.login-card .msg.err { color: #f87171; }

/* ─── Callouts ────────────────────────────────────────────── */
.callout {
    border-radius: 10px; padding: 13px 16px;
    font-size: .85rem; line-height: 1.55;
    display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 18px;
}
.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.callout.info    { background: rgba(59,130,246,.1);  border: 1px solid rgba(59,130,246,.25);  color: #93c5fd; }
.callout.warn    { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.28);  color: #fcd34d; }
.callout.success { background: rgba(34,197,94,.1);   border: 1px solid rgba(34,197,94,.28);   color: #86efac; }
.callout strong { display: block; margin-bottom: 3px; }

/* ─── Instruction steps ───────────────────────────────────── */
.instruction-steps {
    counter-reset: istep;
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 18px;
}
.instruction-step {
    display: flex; gap: 11px; align-items: flex-start;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 9px; padding: 11px 13px;
    font-size: .84rem; line-height: 1.5; color: var(--text-2);
}
.instruction-step::before {
    counter-increment: istep;
    content: counter(istep);
    min-width: 22px; height: 22px;
    background: rgba(59,130,246,.2);
    border: 1px solid rgba(59,130,246,.4);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: .72rem; font-weight: 700;
    color: #93c5fd; flex-shrink: 0;
}
.instruction-step .mono {
    font-family: var(--mono, monospace);
    font-size: .8rem;
    background: rgba(255,255,255,.08);
    padding: 1px 5px; border-radius: 4px;
}

/* ─── Flow diagram ────────────────────────────────────────── */
.flow-diagram {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 18px; flex-wrap: wrap;
}
.flow-node {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px; padding: 8px 12px;
    font-size: .78rem; text-align: center; min-width: 90px;
}
.flow-node strong { display: block; font-size: .83rem; margin-bottom: 2px; }
.flow-node span { color: var(--text-3); }
.flow-node.highlight { background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }
.flow-node.highlight strong { color: #93c5fd; }
.flow-arrow { color: var(--text-3); font-size: 1rem; }

/* ─── Section dividers ────────────────────────────────────── */
.section-label {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-3);
    margin: 22px 0 12px;
    display: flex; align-items: center; gap: 8px;
}
.section-label::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,.07);
}

/* ─── Mono / pre ──────────────────────────────────────────── */
.mono { font-family: var(--mono, monospace); }
pre.output {
    white-space: pre-wrap; background: #020617;
    padding: 16px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    max-height: 380px; overflow: auto;
    font-size: .8rem; line-height: 1.6; margin-top: 16px;
}

/* ─── Watermark toggle ────────────────────────────────────── */
.watermark-toggle {
    display: flex; align-items: center; gap: 10px;
    background: rgba(245,158,11,.08);
    border: 1px solid rgba(245,158,11,.25);
    border-radius: 9px; padding: 11px 13px; margin-top: 12px;
    font-size: .84rem; color: #fcd34d;
}
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: rgba(255,255,255,.15); border-radius: 20px;
    transition: .25s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    height: 14px; width: 14px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: .25s;
}
.toggle-switch input:checked + .toggle-slider { background: #f59e0b; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─── Complete card ───────────────────────────────────────── */
.complete-card {
    text-align: center; padding: 36px;
    background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(59,130,246,.08));
    border: 1px solid rgba(34,197,94,.2);
}
.complete-card h2 { margin: 12px 0 8px; }
.complete-card p { color: var(--text-3); font-size: .9rem; margin-bottom: 22px; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .setup-layout { grid-template-columns: 1fr; }
    .setup-sidebar {
        position: relative; height: auto;
        flex-direction: row; flex-wrap: wrap;
        padding: 16px; gap: 8px;
    }
    .sidebar-header { border: none; padding: 0; margin: 0; width: 100%; }
    .nav-steps { display: flex; flex-wrap: wrap; padding: 0; }
    .nav-step { padding: 7px 10px; }
    .setup-main { padding: 20px; }
    .grid-2 { grid-template-columns: 1fr; }
}
