@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #0a0a0c;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-solid: #141418;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent: #dc2626;
    --accent-hover: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.15);
    --danger: #dc2626;
    --success: #22c55e;
}

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

html {
    scroll-behavior: smooth;
}

*::-webkit-scrollbar { width: 0; height: 0; }
* { scrollbar-width: none; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at 50% 0%, rgba(220, 38, 38, 0.06) 0%, transparent 60%);
    overflow: auto;
    position: relative;
}

.auth-container::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('/passion.svg');
    background-size: 60px 60px;
    background-repeat: repeat;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.auth-box {
    position: relative;
    z-index: 1;
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: authAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.97); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.auth-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 60px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

.auth-box h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-box .subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.auth-box .btn-primary {
    width: 100%;
    margin-top: 4px;
}

.auth-switch {
    text-align: center;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.25s ease;
}

.auth-switch a:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 12px var(--accent-glow);
}

/* ─── Form Elements ─── */
.form-group {
    margin-bottom: 16px;
}

.auth-box .form-group {
    margin-bottom: 12px;
}

.auth-box .error-msg {
    margin-bottom: 8px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    letter-spacing: -0.01em;
}

.form-group input,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 11px 16px;
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text) !important;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.form-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1), 0 0 20px rgba(220, 38, 38, 0.05);
    background: rgba(255,255,255,0.05) !important;
}

input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.error-msg {
    color: var(--danger);
    font-size: 1rem;
    margin-bottom: 8px;
    min-height: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.25), inset 0 1px 1px rgba(255,255,255,0.15);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35), inset 0 1px 1px rgba(255,255,255,0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.dashboard-wrapper {
    flex: 1;
    display: flex;
    min-height: 0;
    align-items: stretch;
}

.sidebar {
    width: 230px;
    min-height: 100%;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 24px 24px 18px;
    font-weight: 800;
    font-size: 1.95rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: all 0.25s ease;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    margin: 2px 8px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-user {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}

.sidebar-user .logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 10px;
    font-size: 1.05rem;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.sidebar-user .logout-link:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--accent-hover);
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

.page {
    display: none;
    animation: pageIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page.active {
    display: block;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.page h2 {
    margin-bottom: 24px;
    font-size: 1.95rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.home-welcome {
    font-size: 1.15rem !important;
    color: var(--text-muted) !important;
}

.home-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.home-buttons .btn {
    padding: 12px 24px;
    min-width: 120px;
    border-radius: 12px;
}

.discord-btn {
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.25);
}

.discord-btn:hover {
    background: linear-gradient(135deg, #6872f2 0%, #5865F2 100%);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}

.hwid-section {
    margin-top: 28px;
    max-width: 680px;
}

.hwid-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.hwid-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    line-height: 1.5;
}

.hwid-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hwid-form input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 500;
    font-family: 'Inter', monospace;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hwid-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.hwid-form input:focus {
    outline: none;
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background: rgba(255,255,255,0.05);
}

.hwid-display {
    margin-top: 4px;
}

.hwid-locked {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 18px 26px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.hwid-locked-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
}

.hwid-locked code {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--success);
    font-family: 'Inter', monospace;
    letter-spacing: 0.02em;
    word-break: break-all;
}

.hwid-locked-hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.account-info-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 22px 28px;
    margin-bottom: 28px;
    max-width: 440px;
}

.account-info-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}

.account-info-row + .account-info-row {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.account-info-label {
    min-width: 100px;
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
}

.account-info-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.profile-form {
    max-width: 440px;
}

.profile-form h3 {
    margin-bottom: 16px;
    font-size: 1.3rem;
    font-weight: 700;
}

.profile-form .form-group {
    margin-bottom: 14px;
}

.profile-form .error-msg {
    margin-bottom: 6px;
    min-height: 16px;
}

.pwd-toggle {
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: all 0.25s ease;
}

.pwd-toggle:hover {
    opacity: 1;
}

/* Blur text - reveal on hover */
.blur-text {
    filter: blur(5px);
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    user-select: none;
}

.blur-text:hover {
    filter: blur(0);
}

.pwd-field-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwd-field-wrap input {
    flex: 1;
}

.pwd-field-wrap .pwd-toggle {
    cursor: pointer;
}

.admin-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding: 0 4px;
}

.admin-tab {
    padding: 14px 22px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    letter-spacing: -0.01em;
}

.admin-tab:hover {
    color: rgba(255,255,255,0.8);
}

.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.admin-panel {
    display: none;
    animation: pageIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.admin-panel.active {
    display: block;
}

.admin-section {
    margin-bottom: 28px;
}

.admin-section h3 {
    margin-bottom: 14px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 18px;
    text-align: left;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    transition: all 0.25s ease;
}

th {
    background: rgba(255,255,255,0.03);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

tr:hover td {
    background: rgba(255,255,255,0.03);
}

.table-wrap table tbody tr:hover td code {
    color: var(--accent);
}

td code {
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-admin { background: rgba(220,38,38,0.15); color: #ef4444; border: 1px solid rgba(220,38,38,0.25); }
.badge-default { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1); }
.badge-active { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.badge-banned { background: rgba(220,38,38,0.12); color: #f87171; border: 1px solid rgba(220,38,38,0.25); }
.badge-member { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6); border: 1px solid rgba(255,255,255,0.1); }
.badge-root { background: rgba(220,38,38,0.15); color: #ef4444; border: 1px solid rgba(220,38,38,0.25); }

td .action-btns {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    border: 1px solid var(--border);
}

.btn-sm:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.1);
    border-color: var(--border-strong);
}

.btn-danger {
    background: rgba(220,38,38,0.15);
    color: #f87171;
    border: 1px solid rgba(220,38,38,0.3);
}

.btn-danger:hover {
    background: rgba(220,38,38,0.25);
    border-color: rgba(220,38,38,0.4);
}

.form-inline {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.form-inline input,
.form-inline select {
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: all 0.25s ease;
    max-width: 180px;
    font-weight: 500;
}

select,
.form-inline select,
.modal select {
    background-color: #141418;
    color: var(--text);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select option {
    background: #141418;
    color: var(--text);
}

.form-inline input:focus,
.form-inline select:focus {
    outline: none;
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-inline .btn {
    padding: 10px 20px;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: overlayIn 0.3s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: linear-gradient(145deg, rgba(20,20,24,0.98) 0%, rgba(14,14,18,0.98) 100%);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 28px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.modal h4 {
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.modal .form-group {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(220,38,38,0.4), transparent 60%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary:hover::before {
    opacity: 1;
}

::selection {
    background: rgba(220, 38, 38, 0.3);
    color: #fff;
}
