/* ==========================================================
   SETTINGS PAGE STYLES
   (ausgelagert aus settings.php)
========================================================== */

:root {
    --accent: #4da6ff;
    --accent-2: #2f80ed;
    --ok: #27ae60;
    --warn: #f39c12;
    --crit: #c0392b;
    --card-bg: rgba(34, 34, 34, 0.85);
    --field-bg: #1c1c1c;
    --border: rgba(255, 255, 255, 0.08);
    --text: #eee;
    --muted: #9aa0a6;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

html {
    background: radial-gradient(
        circle at top center,
        #3a3a3a 0%,
        #232323 40%,
        #141414 100%
    );
    background-attachment: fixed;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    padding: 40px 40px 120px;
    -webkit-font-smoothing: antialiased;
}

.wrapper { max-width: 1280px; margin: 0 auto; }

/* ---------- TOOLBAR ---------- */
.toolbar { margin-bottom: 28px; }
.toolbar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.toolbar a:hover {
    background: rgba(77, 166, 255, 0.12);
    border-color: rgba(77, 166, 255, 0.4);
    transform: translateX(-2px);
}

/* ---------- HEADER ---------- */
.page-header { margin-bottom: 28px; }
h1 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}
h1 .gear { font-size: 26px; }
.meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}
.meta code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    color: #cfd3d7;
    font-size: 12px;
}
.meta .badge {
    display: inline-block;
    background: rgba(77, 166, 255, 0.15);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

/* ---------- MESSAGES ---------- */
.messages { margin-bottom: 24px; }
.msg {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
    backdrop-filter: blur(4px);
}
.msg::before { font-size: 16px; line-height: 1.4; }
.msg.ok   { background: rgba(39, 174, 96, 0.12);  color: #6ee7a0; border-color: rgba(39, 174, 96, 0.35); }
.msg.ok::before   { content: "✓"; }
.msg.warn { background: rgba(243, 156, 18, 0.12); color: #f6c66b; border-color: rgba(243, 156, 18, 0.35); }
.msg.warn::before { content: "⚠"; }
.msg.fail { background: rgba(192, 57, 43, 0.14);  color: #f08a7f; border-color: rgba(192, 57, 43, 0.4); }
.msg.fail::before { content: "✕"; }
.msg code {
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 6px;
    border-radius: 5px;
}

/* ---------- MASONRY COLUMNS (flex, distributed in PHP) ---------- */
.grid {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
.col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (max-width: 900px) {
    .grid { flex-direction: column; }
    .col { width: 100%; }
}

/* ---------- CARD ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 255, 255, 0.14);
}
.card.is-disabled {
    opacity: 0.55;
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    pointer-events: none;
}
.card.is-disabled h2 .dot {
    background: var(--muted);
    box-shadow: none;
}
.card.is-disabled .field input,
.card.is-disabled .field .color-field,
.card.is-disabled .switch .track {
    filter: grayscale(1);
    opacity: 0.5;
}
.card.is-disabled .field input[type=text],
.card.is-disabled .field input[type=number],
.card.is-disabled .field input[type=email],
.card.is-disabled .field input[type=password] {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.05);
    color: #777;
}
.card h2 {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.card h2 .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(77, 166, 255, 0.8);
}

/* ---------- FIELDS ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field.dependent { transition: opacity 0.25s ease; }
.field.is-disabled { opacity: 0.4; }
.field.is-disabled input,
.field.is-disabled .color-field { pointer-events: none; }

.field > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #d6dadf;
}
.field .help {
    display: block;
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    margin-top: 6px;
}
.field input[type=text],
.field input[type=number],
.field input[type=email],
.field input[type=password] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--field-bg);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input::placeholder { color: #5c6166; }
.field input[type=text]:focus,
.field input[type=number]:focus,
.field input[type=email]:focus,
.field input[type=password]:focus {

    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.18);
    background: #202020;
}

/* ---------- COLOR PICKER ---------- */
.color-field { display: flex; align-items: center; gap: 12px; }
.color-field input[type=color] {
    width: 48px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    background: var(--field-bg);
    cursor: pointer;
}
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-field .hexval {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
}

/* ---------- TOGGLE SWITCH ---------- */
.switch {
    display: flex;
    flex-direction: column;     /* label on top, slider underneath */
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
}
.switch .switch-label {
    font-size: 13px;
    font-weight: 600;
    color: #d6dadf;
    line-height: 1.2;
    display: block;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.track {
    position: relative;
    display: block;
    flex: 0 0 auto;
    margin-top: 14px;           /* clear space between text and slider */
    width: 52px;
    height: 28px;
    border-radius: 28px;
    /* OFF state: clearly visible lighter track */
    background: #4b5158;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
    transition: background 0.25s ease, border-color 0.25s ease;
}
.track::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    /* OFF knob: light grey, parked on the left, vertically centered */
    background: #d7dbe0;
    transform: translateY(-50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}
.switch input:checked + .track {
    /* ON state: light track so the blue knob stands out */
    background: #dbe6f5;
    border-color: rgba(77, 166, 255, 0.6);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12),
                0 0 12px rgba(77, 166, 255, 0.5);
}
.switch input:checked + .track::after {
    /* ON knob: blue, slid fully to the right */
    transform: translateY(-50%) translateX(24px);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45),
                0 0 8px rgba(77, 166, 255, 0.7);
}
.switch input:focus-visible + .track {
    outline: 2px solid rgba(77, 166, 255, 0.6);
    outline-offset: 2px;
}

/* ---------- ACTION BAR ---------- */
.actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 40px;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    background: linear-gradient(to top, rgba(15, 15, 15, 0.95), rgba(15, 15, 15, 0));
    backdrop-filter: blur(6px);
    z-index: 10;
}
.btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    padding: 13px 36px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(47, 128, 237, 0.4);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn[disabled] {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    filter: none;
}

@media (max-width: 600px) {
    body { padding: 24px 18px 110px; }
    h1 { font-size: 24px; }
    .actions { padding: 16px 18px; }
    .btn { width: 100%; }
}

/* ==========================================================
   LOCK / LOGIN LIGHTBOX  (Passwortschutz settings.php)
========================================================== */

/* Toolbar mit zwei Aktionen (zurück + sperren) */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar a.lock-out {
    color: var(--warn);
    border-color: rgba(243, 156, 18, 0.30);
}
.toolbar a.lock-out:hover {
    background: rgba(243, 156, 18, 0.12);
    border-color: rgba(243, 156, 18, 0.5);
}

/* Vollflächiges, leicht abgedunkeltes Overlay */
.lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 9, 12, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes lockIn {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* Die eigentliche Box / das Lightbox-Panel */
.lock-box {
    width: 100%;
    max-width: 400px;
    text-align: center;
    background: linear-gradient(180deg, rgba(42, 42, 42, 0.96), rgba(26, 26, 26, 0.96));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: lockIn 0.35s ease both;
}

.lock-ico {
    width: 66px;
    height: 66px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 28px rgba(77, 166, 255, 0.4);
}
.lock-ico.crit {
    background: linear-gradient(135deg, #e23d3d, var(--crit));
    box-shadow: 0 12px 28px rgba(192, 57, 43, 0.45);
}

.lock-box h2 { margin: 0 0 8px; font-size: 21px; font-weight: 800; letter-spacing: -0.2px; }
.lock-box p  { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.lock-box p:last-of-type { margin-bottom: 0; }

.lock-input {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    color: var(--text);
    background: var(--field-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    margin-bottom: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lock-input:focus {
    border-color: rgba(77, 166, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(77, 166, 255, 0.15);
}

.lock-btn {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    transition: transform 0.15s ease, filter 0.15s ease;
}
.lock-btn:hover { transform: translateY(-1px); filter: brightness(1.07); }

.lock-error {
    background: rgba(192, 57, 43, 0.14);
    border: 1px solid rgba(192, 57, 43, 0.4);
    color: #ff9a8f;
    padding: 10px 12px;
    border-radius: 11px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: left;
}

.lock-attempts { margin-top: 16px; font-size: 12px; color: var(--muted); }
.lock-attempts strong { color: var(--text); }

.lock-back {
    display: inline-block;
    margin-top: 18px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.lock-back:hover { text-decoration: underline; }

.lock-box code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
    color: #ffd9a0;
}
.lock-file {
    margin-top: 18px;
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
}

/* ==========================================================
   PASSWORT ÄNDERN  (eigene Karte unter den Einstellungen)
========================================================== */
.password-section {
    margin-top: 24px;
    max-width: 460px;
}
.password-card h2 { text-transform: none; letter-spacing: 0; }
.password-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}
.password-actions .btn { padding: 12px 28px; font-size: 14px; }

@media (max-width: 600px) {
    .password-section { max-width: 100%; }
    .password-actions .btn { width: 100%; }
}

