/* ============================================
   Cryptid — Dark, Serious Theme
   No gradients. Minimal. Clean.
   ============================================ */

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

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-input: #1a1a1a;
    --bg-hover: #1e1e1e;

    --border-primary: #222222;
    --border-secondary: #2a2a2a;
    --border-focus: #444444;

    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --text-muted: #555555;
    --text-accent: #ffffff;

    --accent: #ffffff;
    --accent-hover: #cccccc;
    --danger: #cc3333;
    --danger-hover: #aa2222;
    --success: #33aa55;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);

    --transition: 150ms ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover { opacity: 0.7; }

/* ---- Typography ---- */
h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-accent); }
h2 { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text-accent); }
h3 { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
p { color: var(--text-secondary); }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Navigation ---- */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav__brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.nav__link {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.nav__link:hover { color: var(--text-accent); opacity: 1; }
.nav__link--active { color: var(--text-accent); }

/* ---- Hero Section ---- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    flex: 1;
}

.hero__title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-accent);
    margin-bottom: 16px;
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 48px;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn--primary { background: var(--accent); color: #000000; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); opacity: 1; }

.btn--secondary { background: transparent; color: var(--text-primary); border-color: var(--border-secondary); }
.btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-focus); opacity: 1; }

.btn--danger { background: var(--danger); color: var(--text-accent); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); opacity: 1; }

.btn--success { background: var(--success); color: var(--text-accent); border-color: var(--success); }
.btn--success:hover { background: #2a8a44; border-color: #2a8a44; opacity: 1; }

.btn--small { padding: 6px 14px; font-size: 0.8125rem; }
.btn--full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 32px;
}

.card--centered { max-width: 420px; margin: 0 auto; }
.card__title { font-size: 1.5rem; font-weight: 600; margin-bottom: 8px; color: var(--text-accent); }
.card__subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 32px; }

/* ---- Auth Layout ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ---- Forms ---- */
.form__group { margin-bottom: 20px; }

.form__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form__input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition);
}

.form__input:focus { border-color: var(--border-focus); }
.form__input::placeholder { color: var(--text-muted); }

.form__footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form__footer a { color: var(--text-accent); font-weight: 500; }

/* ---- Alert / Message ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: none;
}

.alert--error {
    background: rgba(204, 51, 51, 0.1);
    border: 1px solid rgba(204, 51, 51, 0.3);
    color: #ff6666;
}

.alert--success {
    background: rgba(51, 170, 85, 0.1);
    border: 1px solid rgba(51, 170, 85, 0.3);
    color: #66dd88;
}

.alert--visible { display: block; }

/* ---- Admin Tabs ---- */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: 32px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.admin-tab {
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}

.admin-tab:hover { color: var(--text-primary); }
.admin-tab--active { color: var(--text-accent); border-bottom-color: var(--text-accent); }

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

/* ---- Profile ---- */
.profile-section { padding: 60px 24px; }

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.profile-info { display: flex; flex-direction: column; gap: 16px; }

.profile-info__item { display: flex; flex-direction: column; gap: 4px; }

.profile-info__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-info__value { font-size: 1rem; color: var(--text-primary); }

/* ---- Admin Section ---- */
.admin-section { padding: 40px 24px; }

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Table ---- */
.table-wrapper { max-width: 960px; margin: 0 auto; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.table th {
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table td { color: var(--text-primary); }
.table tr:hover td { background: var(--bg-hover); }

.table__actions { display: flex; gap: 8px; }

/* ---- Badge ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge--admin {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-accent);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge--user {
    background: rgba(136, 136, 136, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(136, 136, 136, 0.2);
}

.badge--exists {
    background: rgba(51, 170, 85, 0.1);
    color: #66dd88;
    border: 1px solid rgba(51, 170, 85, 0.3);
}

.badge--missing {
    background: rgba(204, 51, 51, 0.1);
    color: #ff6666;
    border: 1px solid rgba(204, 51, 51, 0.3);
}

/* ---- Footer ---- */
.footer {
    padding: 24px;
    text-align: center;
    border-top: 1px solid var(--border-primary);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ---- Loading Spinner ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-secondary);
    border-top-color: var(--text-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utilities ---- */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero__title { font-size: 2.5rem; }
    .hero__subtitle { font-size: 1rem; }
    .profile-grid { grid-template-columns: 1fr; }
    .nav__links { gap: 16px; }
}

@media (max-width: 480px) {
    .hero__title { font-size: 2rem; }
    .card { padding: 24px; }
    .nav { padding: 12px 16px; }
    .nav__link { font-size: 0.8125rem; }
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }
