:root {
    --bg: #080c09;
    --surface: #0d1410;
    --surface-alt: #111a14;
    --border: #1a241d;
    --border-glow: #253028;
    --text: #d4ddd6;
    --text-secondary: #8a9c8e;
    --text-tertiary: #5c6e60;
    --moss: #6b8d68;
    --moss-glow: #8aab87;
    --success: #7ab88a;
    --success-bg: #16241a;
    --fail: #c4847a;
    --fail-bg: #241a1a;
    --warn: #a89850;
    --warn-bg: #24231a;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Newsreader', 'Georgia', 'Times New Roman', serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: oldstyle-nums;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='3' fill='none' stroke='%236b8d68' stroke-width='0.8' opacity='0.7'/%3E%3Ccircle cx='10' cy='10' r='1' fill='%236b8d68' opacity='0.9'/%3E%3C/svg%3E") 10 10, crosshair;
}

body::before {
    content: '';
    position: fixed; inset: -100px;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(100,130,100,0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 70%, rgba(110,140,110,0.03) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(90,120,90,0.02) 0%, transparent 70%);
    z-index: -2; animation: mist-drift 20s ease-in-out infinite; pointer-events: none;
}

@keyframes mist-drift {
    0%, 100% { transform: translate(0,0) scale(1); }
    25% { transform: translate(2%,-1%) scale(1.02); }
    50% { transform: translate(-1%,1%) scale(0.98); }
    75% { transform: translate(1%,0.5%) scale(1.01); }
}

.fog-layer { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.fog-layer canvas { width: 100%; height: 100%; display: block; }

.forest-web { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.forest-web canvas { width: 100%; height: 100%; display: block; }

/* ── AMBIENT GREEN STRIPS ── */
@keyframes green-ambient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.forest-strip {
    height: 1.5px; width: 100%;
    background: linear-gradient(90deg,
        #1a2e1a, #1f3520, #243e26, #2a472c, #305232, #2a472c, #243e26, #1f3520, #1a2e1a);
    background-size: 200% 100%;
    animation: green-ambient 5s ease-in-out infinite;
    flex-shrink: 0;
    position: fixed; top: 0; left: 0; z-index: 100;
    will-change: background-position;
    opacity: 0.85;
    box-shadow: 0 1px 8px rgba(30,60,30,0.3);
}
.forest-strip-bottom {
    height: 1.5px; width: 100%;
    background: linear-gradient(90deg,
        #1a2e1a, #1f3520, #243e26, #2a472c, #305232, #2a472c, #243e26, #1f3520, #1a2e1a);
    background-size: 200% 100%;
    animation: green-ambient 5s ease-in-out infinite reverse;
    flex-shrink: 0;
    position: fixed; bottom: 0; left: 0; z-index: 100;
    will-change: background-position;
    opacity: 0.85;
    box-shadow: 0 -1px 8px rgba(30,60,30,0.3);
}

/* ── AUDIO PLAYER ── */
.audio-controls {
    position: fixed; bottom: 28px; right: 28px; z-index: 200;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.audio-toggle {
    background: rgba(13,20,16,0.85); border: 1px solid var(--border);
    color: var(--moss); font-family: 'Newsreader', serif; font-size: 11px;
    font-style: italic; padding: 6px 14px; border-radius: 16px;
    cursor: pointer; transition: all 0.3s; letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
}
.audio-toggle:hover { border-color: var(--moss); color: var(--moss-glow); }
.audio-toggle.muted { color: var(--text-tertiary); }
.eq-bars {
    display: flex; gap: 2px; align-items: flex-end; height: 28px;
}
.eq-bar {
    width: 3px; background: var(--moss); border-radius: 1px;
    transition: height 0.15s ease;
    opacity: 0.8;
}

/* ── MAIN ── */
.main-wrap {
    max-width: 740px; width: 100%; margin: 0 auto;
    padding: 56px 36px 56px; flex: 1; position: relative; z-index: 10;
}

header {
    margin-bottom: 44px; padding-top: 12px;
    border-left: 1px solid var(--border-glow); padding-left: 20px;
    transition: border-color 0.5s;
}
header:hover { border-left-color: var(--moss); }

header h1 {
    font-family: 'Newsreader', serif; font-size: 34px; font-weight: 200;
    letter-spacing: -0.8px; color: var(--text); margin-bottom: 4px;
    transition: color 0.4s, text-shadow 0.4s;
}
header h1:hover {
    color: var(--moss-glow);
    text-shadow: 0 0 60px rgba(138,171,135,0.2), 0 0 120px rgba(138,171,135,0.08);
}
header .subtitle {
    font-family: 'Newsreader', serif; font-size: 14px; color: var(--text-secondary);
    font-style: italic; letter-spacing: 0.3px; font-weight: 300;
}

.section-label {
    font-family: 'Newsreader', serif; font-size: 10px; text-transform: lowercase;
    letter-spacing: 2.5px; color: var(--text-tertiary); margin-bottom: 10px;
    font-weight: 400; font-style: italic;
    transition: color 0.3s;
}
.section-label:hover { color: var(--moss); }

/* ── FORM INPUTS ── */
.form-input {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 18px;
    font-family: 'Newsreader', serif; font-size: 14px; color: var(--text);
    outline: none; transition: all 0.4s var(--ease-out-expo);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}
.form-input::placeholder { color: var(--text-tertiary); font-style: italic; }
.form-input:focus {
    border-color: var(--moss);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 0 40px rgba(107,141,104,0.06);
    background: var(--surface-alt);
}

.flash {
    font-family: 'Newsreader', serif; font-size: 13px;
    padding: 12px 18px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface);
    animation: mossSlide 0.4s var(--ease-spring);
}
.flash-success { color: var(--success); border-color: rgba(122,184,138,0.25); background: var(--success-bg); }
.flash-danger { color: var(--fail); border-color: rgba(196,132,122,0.25); background: var(--fail-bg); }
.flash-info { color: var(--warn); border-color: rgba(168,152,80,0.25); background: var(--warn-bg); }

/* ── LOGIN HEADER / LOGOUT ── */
.top-bar {
    display: flex; justify-content: flex-end; align-items: center;
    margin-bottom: 20px;
}
.top-bar a {
    font-family: 'Newsreader', serif; font-size: 11px; color: var(--text-tertiary);
    text-decoration: none; font-style: italic; transition: color 0.3s;
}
.top-bar a:hover { color: var(--moss); }

/* ── TEXTAREA ── */
textarea {
    width: 100%; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px 20px;
    font-family: 'Newsreader', serif; font-size: 14px; color: var(--text);
    outline: none; resize: vertical; min-height: 130px; line-height: 1.8;
    transition: all 0.4s var(--ease-out-expo); margin-bottom: 28px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}
textarea::placeholder { color: var(--text-tertiary); font-style: italic; font-family: 'Newsreader', serif; }
textarea:focus {
    border-color: var(--moss);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 0 40px rgba(107,141,104,0.06);
    background: var(--surface-alt);
}

.proxy-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 28px; }
.proxy-row {
    display: flex; align-items: center; gap: 12px;
    animation: mossSlide 0.4s var(--ease-spring);
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}
.proxy-row:hover { border-bottom-color: rgba(107,141,104,0.12); }

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

.proxy-row .line-num {
    font-family: 'Newsreader', serif; font-size: 11px; color: var(--text-tertiary);
    min-width: 24px; text-align: right; font-weight: 300;
    font-variant-numeric: oldstyle-nums;
}
.proxy-row .email-preview {
    font-family: 'Newsreader', serif; font-size: 13px; color: var(--text-secondary);
    min-width: 150px; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-style: italic; font-weight: 300;
}
.proxy-row input {
    flex: 1; background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 14px;
    font-family: 'Newsreader', serif; font-size: 13px; color: var(--text);
    outline: none; transition: all 0.3s var(--ease-out-expo);
}
.proxy-row input::placeholder { color: var(--text-tertiary); font-style: italic; font-family: 'Newsreader', serif; }
.proxy-row input:focus {
    border-color: var(--moss);
    box-shadow: 0 0 20px rgba(107,141,104,0.06);
    background: var(--surface-alt);
}

.row-bottom { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }

.btn {
    background: linear-gradient(135deg, var(--moss) 0%, #5a7a57 100%);
    color: #080c09; border: none; border-radius: 28px;
    padding: 13px 34px;
    font-family: 'Newsreader', serif; font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo); letter-spacing: 0.3px;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 20px rgba(107,141,104,0.15);
}
.btn::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.06) 40%, transparent 80%);
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-out-expo);
}
.btn:hover::before { transform: translateX(100%); }
.btn:hover {
    background: linear-gradient(135deg, var(--moss-glow) 0%, #7a9c77 100%);
    box-shadow: 0 6px 32px rgba(138,171,135,0.25), 0 0 60px rgba(107,141,104,0.1);
    transform: translateY(-1px);
}
.btn:disabled {
    background: linear-gradient(135deg, #1a241d 0%, #1a241d 100%);
    color: #3a4a3e; cursor: not-allowed; box-shadow: none; transform: none;
}
.btn:disabled::before { display: none; }
.btn:active { transform: scale(0.95); transition: transform 0.1s; }

.progress-wrap { margin-bottom: 24px; display: none; }
.progress-wrap.visible { display: block; }
.progress-bar { height: 2px; background: var(--border); border-radius: 1px; overflow: hidden; }
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--moss), var(--moss-glow));
    border-radius: 1px; transition: width 0.6s var(--ease-out-expo); width: 0%;
    box-shadow: 0 0 12px rgba(107,141,104,0.3);
}
.counter-text {
    font-family: 'Newsreader', serif; font-size: 11px; color: var(--text-tertiary);
    margin-top: 10px; text-transform: lowercase; font-style: italic; font-weight: 300;
}

.results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.result-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 15px 20px;
    display: flex; align-items: center; gap: 14px;
    animation: mossSlide 0.35s var(--ease-spring);
    transition: all 0.3s var(--ease-out-expo);
    position: relative; overflow: hidden;
}
.result-card::after {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: var(--moss); transform: scaleY(0);
    transition: transform 0.4s var(--ease-spring); border-radius: 0 2px 2px 0;
}
.result-card:hover::after { transform: scaleY(1); }
.result-card:hover {
    border-color: var(--border-glow);
    background: var(--surface-alt);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.result-card .r-idx {
    font-family: 'Newsreader', serif; font-size: 12px; color: var(--text-tertiary);
    min-width: 22px; font-variant-numeric: oldstyle-nums; font-weight: 300;
}
.result-card .r-email {
    flex: 1; font-family: 'Newsreader', serif; font-size: 14px; font-weight: 400;
    word-break: break-all; transition: all 0.25s;
}
.result-card:hover .r-email {
    animation: glitch-moss 0.35s ease;
    text-shadow: 1px 0 0 rgba(107,141,104,0.5), -1px 0 0 rgba(130,160,127,0.3);
}
@keyframes glitch-moss {
    0% { transform: translate(0); } 15% { transform: translate(-1.5px,1px); }
    30% { transform: translate(1px,-0.5px); } 45% { transform: translate(-0.5px,-1px); }
    60% { transform: translate(1.5px,0); } 75% { transform: translate(-1px,0.5px); }
    100% { transform: translate(0); }
}
.result-card .r-status {
    font-family: 'Newsreader', serif; font-size: 11px; font-style: italic;
    color: var(--text-tertiary); margin-right: 4px; font-weight: 300;
}

.badge {
    font-family: 'Newsreader', serif; padding: 4px 12px; border-radius: 16px;
    font-size: 10px; font-weight: 500; text-transform: lowercase;
    letter-spacing: 0.4px; flex-shrink: 0; transition: all 0.3s;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-fail { background: var(--fail-bg); color: var(--fail); }
.badge-pending {
    background: var(--warn-bg); color: var(--warn);
    animation: breathe-badge 2.5s ease-in-out infinite;
}
.badge-timeout { background: rgba(60,60,50,0.3); color: #8a8a7a; }
.badge-mfa { background: rgba(80,60,40,0.3); color: #c9a86c; }
.badge-shield { background: rgba(50,50,80,0.3); color: #8a9ac9; }
.badge-proxy { background: rgba(60,40,40,0.3); color: #b08080; }

@keyframes breathe-badge {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 rgba(168,152,80,0); }
    50% { opacity: 0.6; box-shadow: 0 0 12px rgba(168,152,80,0.12); }
}

.artifact-toggle {
    font-family: 'Newsreader', serif; font-size: 11px; color: var(--moss);
    cursor: pointer; flex-shrink: 0; font-style: italic; font-weight: 400;
    transition: color 0.3s;
}
.artifact-toggle:hover { color: var(--moss-glow); }
.artifact-pre {
    display: none; width: 100%; margin-top: 10px;
    background: #060a07; border-radius: 8px;
    padding: 12px 14px;
    font-family: 'Newsreader', serif; font-size: 11px; color: var(--text-secondary);
    word-break: break-all; max-height: 150px; overflow-y: auto;
    line-height: 1.6; border: 1px solid var(--border);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--moss); }
