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

:root {
    --bg: #080808;
    --surface: #111111;
    --surface2: #161616;
    --border: rgba(255,255,255,0.06);
    --text: #f0f0f0;
    --muted: rgba(255,255,255,0.4);
    --accent: #3b82f6;
    --accent2: #14b8a6;
    --green: #22c55e;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
}

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

.brand {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 60px rgba(0,0,0,0.4);
    animation: fade-up 0.6s var(--ease);
}

.card.wide { max-width: 760px; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}

p.subtitle {
    color: var(--muted);
    margin: 0 0 24px;
    font-size: 0.925rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin: 16px 0 6px;
}

input[type="text"], input[type="email"], input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s var(--ease);
}

input:focus {
    outline: none;
    border-color: var(--accent);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.checkbox-row input { width: auto; }

button, .btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
    text-align: center;
    display: inline-block;
}

.btn-primary { background: var(--accent); color: #fff; margin-top: 24px; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }

.hint { font-size: 0.8rem; margin-top: 6px; min-height: 1em; }
.hint.ok { color: var(--green); }
.hint.error { color: #f87171; }
.hint.muted { color: var(--muted); }

.form-error {
    background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.3);
    color: #f87171;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.form-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
    color: var(--green);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.footer-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(20,184,166,0.12);
    color: var(--accent2);
    border: 1px solid rgba(20,184,166,0.25);
}

/* --- Dashboard --- */
.dash-wrap { width: 100%; max-width: 920px; display: flex; flex-direction: column; gap: 20px; }

.dash-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px 28px;
    animation: fade-up 0.6s var(--ease);
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(20,184,166,0.15);
    color: var(--accent2);
    border: 1px solid rgba(20,184,166,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    animation: fade-up 0.6s var(--ease);
}

.dash-card h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
}

.credits-value {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent2);
}

.service-list { display: flex; flex-direction: column; gap: 8px; }

.service-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s var(--ease);
}

.service-link:hover { transform: translateX(2px); border-color: rgba(59,130,246,0.4); }

.ref-box {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.875rem;
}

.ref-box code { flex: 1; overflow-x: auto; white-space: nowrap; color: var(--muted); }

.copy-btn {
    width: auto;
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--accent);
    color: #fff;
    margin: 0;
    border-radius: 8px;
}

.empty-state { color: var(--muted); font-size: 0.9rem; }

.logout-link {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 10px;
}
.logout-link:hover { color: var(--text); }

@media (max-width: 600px) {
    .card { padding: 24px; border-radius: 16px; }
    .dash-header { flex-wrap: wrap; }
}
