*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #020617;
    --panel: rgba(15, 23, 42, 0.72);
    --border: rgba(51, 65, 85, 0.7);
    --text: #f8fafc;
    --muted: #94a3b8;
    --dim: #475569;
    --accent: #60a5fa;
    --error: #f87171;
    --warn-bg: rgba(234, 179, 8, 0.1);
    --warn-border: rgba(234, 179, 8, 0.3);
    --warn-text: #fde047;
}

/* Accent Theme Variations */
html[data-accent="red"] { --accent: #ef4444; }
html[data-accent="orange"] { --accent: #f97316; }
html[data-accent="yellow"] { --accent: #eab308; }
html[data-accent="green"] { --accent: #34d399; }
html[data-accent="blue"] { --accent: #60a5fa; }
html[data-accent="purple"] { --accent: #a78bfa; }
html[data-accent="pink"] { --accent: #f472b6; }
html[data-accent="white"] { --accent: #ffffff; }
html[data-accent="gray"] { --accent: #94a3b8; }
html[data-accent="black"] { --accent: #0f172a; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    margin: 0;
    min-height: 100vh;
}

.container {
    width: min(720px, calc(100% - 32px));
    margin: 0 auto;
    padding: 60px 0;
}

.back {
    display: inline-block;
    color: var(--dim);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 25px;
}

.back:hover {
    color: var(--text);
}

h1 {
    font-family: "Syne", sans-serif;
    font-size: 2.4rem;
    margin: 0 0 8px;
}

.subtitle {
    color: var(--muted);
    margin: 0 0 25px;
}

.notice-box {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--warn-text);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section {
    margin-bottom: 24px;
}

.section-title {
    font-family: "Syne", sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--dim);
    margin: 0 0 9px 6px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(14px);
}

.setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.setting:last-child {
    border-bottom: 0;
}

.setting-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.badge-preview {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.setting-name {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 0.92rem;
}

.setting-description {
    font-size: 0.78rem;
    color: var(--muted);
}

.perm-warning {
    color: var(--error);
    font-size: 0.72rem;
    margin-top: 3px;
    font-weight: 600;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

input[type="text"],
textarea {
    background: rgba(2, 6, 23, 0.7);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    width: 240px;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--accent);
}

input[type="text"].invalid {
    border-color: var(--error) !important;
}

.error-text {
    font-size: 0.72rem;
    color: var(--error);
    display: none;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    background: rgba(2, 6, 23, 0.4);
    transition: border-color 0.2s, background 0.2s;
    max-width: 240px;
    width: 100%;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(30, 41, 59, 0.6);
}

.drop-zone-text {
    font-size: 0.78rem;
    color: var(--muted);
}

.drop-zone-text strong {
    color: var(--accent);
}

.drop-zone input[type="file"] {
    display: none;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #334155;
    border-radius: 999px;
    transition: 0.2s ease;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s ease;
}

.toggle input:checked + .toggle-slider {
    background: #2563eb;
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

select {
    background: rgba(2, 6, 23, 0.7);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    font-family: inherit;
    outline: none;
}

.accent-options {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 260px;
}

.accent {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.accent:hover {
    transform: scale(1.1);
}

.accent.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--accent);
}

/* Accent Swatches */
.red { background: #ef4444; }
.orange { background: #f97316; }
.yellow { background: #eab308; }
.green { background: #34d399; }
.blue { background: #60a5fa; }
.purple { background: #a78bfa; }
.pink { background: #f472b6; }
.white { background: #ffffff; }
.gray { background: #94a3b8; }
.black {
    background: #0f172a;
    border: 1px solid #334155;
}

.danger {
    width: 100%;
    margin-top: 15px;
    padding: 13px;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: rgba(127, 29, 29, 0.15);
    color: #fca5a5;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.danger:hover {
    background: rgba(127, 29, 29, 0.25);
}
