/* IG Changer Web — ig_checker.py color scheme */

:root {
    /* Exakt die Checker-Palette */
    --bg:         #080809;
    --panel:      #0f0f11;
    --glass:      #141416;
    --edge:       #202024;
    --input:      #1c1c20;
    --fg:         #f0f0f2;
    --muted:      #6a6a70;
    --red:        #CF041D;
    --red-h:      #E8192C;
    --green:      #00d084;
    --gold:       #f5a623;
    --fail:       #ff453a;

    --radius:     6px;
    --radius-lg:  10px;
    --shadow:     0 2px 8px rgba(0,0,0,0.5);
    --shadow-lg:  0 12px 40px rgba(0,0,0,0.7);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

a { color: var(--red); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--red-h); }

::selection {
    background: rgba(207,4,29,0.25);
    color: var(--fg);
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--edge);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 200;
}

.topbar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    height: 32px;
    width: auto;
    border-radius: 6px;
}

.logo-sep {
    color: var(--edge);
    font-weight: 200;
    font-size: 20px;
    margin: 0 2px;
}

.logo-sub {
    color: var(--muted);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.key-badge {
    color: var(--muted);
    font-size: 11px;
    font-family: 'Consolas', 'Courier New', monospace;
    background: var(--glass);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--edge);
    letter-spacing: 0.5px;
}

.nav-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--fg);
    background: var(--glass);
}

.nav-admin {
    color: var(--red);
    font-weight: 600;
}

.nav-admin:hover {
    color: var(--red-h);
    background: rgba(207,4,29,0.08);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 24px;
    flex: 1;
    width: 100%;
}

/* ── Flash Messages ──────────────────────────────────────────────────────── */
.flash {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash::before { font-size: 14px; flex-shrink: 0; }

.flash-error {
    background: #2a0608;
    color: var(--fail);
    border: 1px solid #4a1015;
}
.flash-error::before { content: "✕"; }

.flash-success {
    background: #062a10;
    color: var(--green);
    border: 1px solid #0a4a1a;
}
.flash-success::before { content: "✓"; }

.flash-warning {
    background: #2a1e06;
    color: var(--gold);
    border: 1px solid #4a3410;
}
.flash-warning::before { content: "!"; }

.flash-info {
    background: var(--glass);
    color: var(--muted);
    border: 1px solid var(--edge);
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg);
    letter-spacing: -0.3px;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--edge);
}

.card-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-body {
    padding: 22px;
}

.card-body-log {
    padding: 0;
}

/* ── Auth Pages ──────────────────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72vh;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
    border-radius: 2px;
}

/* ── 3D Login Card ────────────────────────────────────────────────────────── */
.login-card-3d {
    perspective: 1000px;
    width: 100%;
    max-width: 380px;
}

.login-card-inner {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 16px;
    padding: 44px 36px 32px;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 4px 16px rgba(0,0,0,0.4),
        0 16px 48px rgba(0,0,0,0.4),
        0 0 60px rgba(207,4,29,0.04);
}

.login-glow {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    transition: background 0.3s;
    z-index: 0;
}

.login-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.login-card-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, rgba(207,4,29,0.03), transparent);
    pointer-events: none;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.login-logo img {
    height: 56px;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(207,4,29,0.25);
    transition: transform 0.3s;
}

.login-card-3d:hover .login-logo img {
    transform: scale(1.05);
}

.login-field {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.login-field label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input);
    border: 1px solid var(--edge);
    border-radius: 8px;
    color: var(--fg);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    outline: none;
    transition: all 0.25s;
}

.login-input::placeholder {
    color: #3a3a42;
    font-weight: 400;
    letter-spacing: 3px;
}

.login-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(207,4,29,0.12), 0 0 20px rgba(207,4,29,0.08);
    background: #111114;
}

.login-btn {
    width: 100%;
    padding: 13px 20px;
    background: var(--red);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
}

.login-btn:hover {
    background: var(--red-h);
    box-shadow: 0 4px 20px rgba(207,4,29,0.3);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer-text {
    text-align: center;
    color: #2e2e34;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    margin-top: 24px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.auth-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-sub {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 28px;
}

/* Moon Canvas Background */
#moon-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.auth-wrapper {
    position: relative;
    z-index: 1;
}

.topbar {
    position: relative;
    z-index: 200;
}

.footer {
    position: relative;
    z-index: 1;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.input-field {
    width: 100%;
    padding: 12px 14px;
    background: var(--input);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(207,4,29,0.15);
}

.input-field::placeholder {
    color: #4a4a50;
}

.input-mono {
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}

.form-hint {
    color: var(--muted);
    font-size: 12px;
    margin-top: 14px;
    line-height: 1.5;
}

.form-row {
    display: flex;
    gap: 14px;
}

.form-row .form-group { flex: 1; }

/* Radio */
.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 6px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.radio-label:hover { color: #fff; }

.radio-label input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--edge);
    border-radius: 50%;
    background: var(--input);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

.radio-label input[type="radio"]:checked {
    border-color: var(--red);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
}

/* Phone */
.phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-plus {
    color: var(--muted);
    font-size: 18px;
    font-weight: 700;
}

.input-dial { width: 70px !important; text-align: center; }
.input-phone { flex: 1; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--fg);
    background: var(--input);
    white-space: nowrap;
}

.btn:hover {
    background: #262630;
    border-color: #3a3a42;
    color: #fff;
}

.btn-primary {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--red-h);
    border-color: var(--red-h);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger {
    color: var(--fail);
    border-color: #4a1015;
    background: transparent;
}

.btn-danger:hover {
    background: #2a0608;
    border-color: #6a1520;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}

.btn-ghost:hover {
    background: var(--glass);
    color: var(--fg);
}

.btn-full { width: 100%; padding: 12px 20px; font-size: 14px; }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active  { background: #062a10; color: var(--green); }
.badge-off     { background: #2a0608; color: var(--fail);  }
.badge-idle    { background: var(--glass); color: var(--muted); }
.badge-queued  { background: #2a1e06; color: var(--gold);  }
.badge-running { background: #0a1a2a; color: #4da6ff;     }
.badge-done    { background: #062a10; color: var(--green); }
.badge-failed  { background: #2a0608; color: var(--fail);  }

.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.status-idle    { background: var(--glass); color: var(--muted); }
.status-queued  { background: #2a1e06; color: var(--gold);  }
.status-running { background: #0a1a2a; color: #4da6ff;     }
.status-done    { background: #062a10; color: var(--green); }
.status-failed  { background: #2a0608; color: var(--fail);  }

/* ── Log Area ────────────────────────────────────────────────────────────── */
.log-area {
    background: #0a0a0c;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 16px 20px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.log-placeholder {
    color: var(--muted);
    font-style: italic;
}

.log-line {
    color: var(--muted);
    padding: 4px 0;
    word-break: break-all;
    display: flex;
    align-items: flex-start;
    gap: 0;
    font-size: 12.5px;
    line-height: 1.5;
}

.log-line .log-time {
    color: #3a3a40;
    margin-right: 8px;
    font-size: 11px;
    flex-shrink: 0;
    font-family: 'Consolas', monospace;
    min-width: 62px;
}

.log-line .log-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    margin-right: 6px;
    font-size: 11px;
}

.log-line .log-msg {
    flex: 1;
    min-width: 0;
}

.log-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
    margin: 6px 0;
}

.log-success       { color: var(--green); font-weight: 600; }
.log-success .log-icon { color: var(--green); }

.log-error         { color: var(--fail); font-weight: 600; }
.log-error .log-icon   { color: var(--fail); }

.log-account       { color: #e0e0e4; }
.log-account .log-icon { color: var(--red); }

.log-method        { color: #b8b8c0; }
.log-method .log-icon  { color: #ff6b35; }

.log-target        { color: #e0e0e4; }
.log-target .log-icon  { color: var(--red); }

.log-browser       { color: #8888a0; }
.log-browser .log-icon { color: #6a6a80; }

.log-session       { color: #66bb6a; }
.log-session .log-icon { color: #66bb6a; }

.log-wait          { color: #ffa726; font-style: italic; }
.log-wait .log-icon    { color: #ffa726; }

.log-http          { color: #8888a0; }
.log-http .log-icon    { color: #6a6a80; }

.log-detail        { color: #7a7a90; }
.log-detail .log-icon  { color: #4a4a5a; }

.log-result        { color: #e0e0e4; font-weight: 600; }
.log-result .log-icon  { color: #ffd700; }

.log-save          { color: #7a7a90; font-size: 11px; }
.log-save .log-icon    { color: #6a6a80; }

.log-start         { color: #e0e0e4; font-weight: 600; }
.log-start .log-icon   { color: var(--red); }

.log-stealth       { color: #7a7a90; }
.log-stealth .log-icon { color: #6a6a80; }

.log-info          { color: var(--muted); }
.log-sep           { padding: 0; }

.log-arrow     { color: var(--red); font-weight: 700; }
.log-http-ok   { color: #66bb6a; font-weight: 600; }
.log-highlight-ok { color: #66bb6a; font-weight: 700; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--edge);
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #1a1a1e;
    color: var(--fg);
}

.table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.text-mono {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: var(--muted);
}

.muted { color: var(--muted); }

.action-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Dashboard Tabs ─────────────────────────────────────────────────────── */
.dash-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--radius-lg);
    padding: 4px;
    width: fit-content;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.tab-btn:hover {
    color: var(--fg);
    background: rgba(255,255,255,0.04);
}

.tab-btn.active {
    background: var(--red);
    color: #fff;
    box-shadow: 0 2px 8px rgba(207,4,29,0.3);
}

.tab-icon {
    font-size: 14px;
}

.tab-count {
    background: rgba(255,255,255,0.15);
    color: inherit;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.tab-btn.active .tab-count {
    background: rgba(255,255,255,0.25);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ── Dashboard Grid ──────────────────────────────────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8,8,9,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: var(--radius-lg);
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.92) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 700;
}

.modal-icon-danger {
    background: #2a0608;
    color: var(--fail);
}

.modal h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--fg);
}

.modal p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal p strong {
    color: var(--fg);
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions .btn {
    min-width: 90px;
}

/* ── History ─────────────────────────────────────────────────────────────── */
.history-row.row-success td:first-child {
    border-left: 3px solid var(--green);
}

.history-row.row-fail td:first-child {
    border-left: 3px solid var(--fail);
}

.action-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.action-email {
    background: rgba(207,4,29,0.12);
    color: #ff4455;
}

.action-phone {
    background: rgba(33,150,243,0.12);
    color: #64b5f6;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

.empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
    font-style: italic;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 18px 24px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    border-top: 1px solid var(--edge);
    margin-top: auto;
    letter-spacing: 0.3px;
    background: var(--panel);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
    .topbar-right { gap: 8px; }
    .key-badge { display: none; }
    .form-row { flex-direction: column; gap: 0; }
    .action-cell { flex-direction: column; gap: 4px; }
    .table { font-size: 12px; }
    .table th, .table td { padding: 8px 10px; }
    .auth-card { padding: 32px 24px; margin: 0 12px; }
    .container { padding: 20px 16px; }
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--edge);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a40; }
