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

:root {
    --bg-sidebar: #faf5ef;
    --bg-content: #ffffff;
    --bg-page: #f7f7f7;
    --accent: #0cb8b8;
    --accent-hover: #0a9e9e;
    --text: #1a1a1a;
    --text-muted: #888;
    --border: #e5e5e5;
    --error: #e53e3e;
    --warning-bg: #fffbeb;
    --warning-border: #f6ad55;
    --code-bg: #1e1e2e;
    --code-text: #cdd6f4;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-sidebar);
}

.login-card {
    background: var(--bg-content);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.otp-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Forms */
label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

input[type="email"],
input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
    margin-bottom: 12px;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(12, 184, 184, 0.12);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-full { width: 100%; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 6px 0;
    font-size: 13px;
    cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger {
    background: var(--error);
    color: #fff;
    padding: 5px 12px;
    font-size: 13px;
}
.btn-danger:hover { opacity: 0.85; }

.btn-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    color: var(--code-text);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
}
.btn-copy:hover { background: rgba(255,255,255,0.2); }

/* Error message */
.error-msg {
    background: #fff5f5;
    color: var(--error);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-top: 12px;
    border: 1px solid #fed7d7;
}

/* Dashboard layout */
#dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
}

.sidebar-top { padding: 20px 16px; }

.sidebar-logo {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 24px;
    padding: 0 8px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.12s;
}

.nav-item:hover { background: rgba(0,0,0,0.04); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-bottom {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-version {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sidebar-user {
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    word-break: break-all;
}

/* Content area */
.content {
    flex: 1;
    margin-left: 240px;
    padding: 32px 40px;
    max-width: 900px;
}

.content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Cards */
.card {
    background: var(--bg-content);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.text-muted { color: var(--text-muted); font-size: 14px; }

/* Steps */
.steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.alert a {
    color: var(--accent);
}

/* Form group */
.form-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.form-group input {
    flex: 1;
    margin-bottom: 0;
}

/* API key display */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-page);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 8px;
}

.api-key-display code {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 14px;
    flex: 1;
}

/* Code blocks */
.code-block {
    position: relative;
    background: var(--code-bg);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    margin-top: 8px;
}

.code-block pre {
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--code-text);
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

/* Accounts list */
.account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.account-item:last-child { border-bottom: none; }

.account-login {
    font-weight: 600;
    font-size: 14px;
}

.account-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 1000;
    animation: toast-in 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .content { margin-left: 200px; padding: 20px; }
}
