/* =========================================================
   Dropbox OAuth 2.0 — Global Stylesheet
   ========================================================= */

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

:root {
    --blue:        #0061FF;
    --blue-dark:   #0047CC;
    --blue-light:  #E8F0FF;
    --surface:     rgba(255,255,255,0.07);
    --surface-2:   rgba(255,255,255,0.12);
    --border:      rgba(255,255,255,0.13);
    --text:        #e8eaf0;
    --text-muted:  #94a3b8;
    --danger:      #ef4444;
    --success:     #22c55e;
    --radius:      18px;
    --radius-sm:   10px;
    --shadow:      0 25px 60px rgba(0,0,0,0.45);
    --font:        'Inter', system-ui, sans-serif;
    --transition:  0.25s cubic-bezier(.4,0,.2,1);
}

html, body {
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: #0a0e1a;
    overflow-x: hidden;
}

/* ── Background Gradient ── */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% -10%, rgba(0,97,255,0.30) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 110%, rgba(0,97,255,0.18) 0%, transparent 55%),
        linear-gradient(135deg, #0a0e1a 0%, #0d1428 100%);
    pointer-events: none;
}

/* ── Layout ── */
.container { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.center-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

/* ── Glass Card ── */
.card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.glass-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
    animation: fadeUp .5s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Logo Area ── */
.logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 24px; }
.dropbox-icon { width: 64px; height: 64px; background: var(--blue-light); border-radius: 16px; display: flex; align-items: center; justify-content: center; padding: 12px; }
.dropbox-icon svg { width: 100%; height: 100%; }
.brand { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.5px; }

/* ── Subtitle ── */
.subtitle { color: var(--text-muted); line-height: 1.6; margin-bottom: 28px; font-size: 0.95rem; }

/* ── Permissions Grid ── */
.permissions-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; text-align: left; }
.permission-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    transition: background var(--transition);
}
.permission-item:hover { background: rgba(255,255,255,0.17); }
.perm-icon { font-size: 1.4rem; flex-shrink: 0; }
.permission-item strong { display: block; font-size: 0.9rem; }
.permission-item small { color: var(--text-muted); font-size: 0.78rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font); font-weight: 600; font-size: 1rem;
    border: none; cursor: pointer; text-decoration: none;
    border-radius: var(--radius-sm); padding: 14px 28px;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: #fff; width: 100%;
    box-shadow: 0 8px 30px rgba(0,97,255,0.4);
}
.btn-primary:hover { box-shadow: 0 12px 40px rgba(0,97,255,0.55); }

.btn-secondary {
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border);
}
.btn-logout {
    background: rgba(239,68,68,0.15); color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.25);
    padding: 8px 18px; font-size: 0.85rem; border-radius: 8px;
}
.btn-logout:hover { background: rgba(239,68,68,0.3); }

/* ── Security Note ── */
.security-note { margin-top: 16px; font-size: 0.8rem; color: var(--text-muted); }

/* ── Redirect Info Box ── */
.redirect-info {
    margin-top: 24px; text-align: left;
    background: rgba(0,97,255,0.10); border: 1px solid rgba(0,97,255,0.25);
    border-radius: var(--radius-sm); padding: 14px 16px; font-size: 0.82rem;
}
.redirect-info strong { display: block; margin-bottom: 6px; color: #93c5fd; }
.redirect-info code {
    word-break: break-all; color: #a5f3fc;
    background: rgba(0,0,0,0.2); padding: 4px 8px; border-radius: 6px;
    display: block; margin-top: 4px;
}

/* ── NAVBAR ── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 32px;
    background: rgba(10,14,26,0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.nav-logo  { width: 28px; height: 28px; }
.nav-user  { display: flex; align-items: center; gap: 14px; }
.user-name { color: var(--text-muted); font-size: 0.9rem; }

/* ── DASHBOARD ── */
.dashboard { padding-top: 100px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard .card { padding: 28px; }

.account-card { display: flex; align-items: center; gap: 20px; grid-column: span 2; }
.account-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--blue) 0%, #7c3aed 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 700; flex-shrink: 0;
}
.account-info h2 { font-size: 1.3rem; font-weight: 600; }
.account-info p  { color: var(--text-muted); font-size: 0.9rem; margin: 4px 0 8px; }
.badge {
    display: inline-block; background: rgba(0,97,255,0.2); color: #93c5fd;
    border: 1px solid rgba(0,97,255,0.3); border-radius: 999px;
    padding: 2px 12px; font-size: 0.78rem; font-weight: 500;
}

/* ── Storage Card ── */
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.storage-bar-wrap { display: flex; align-items: center; gap: 12px; }
.storage-bar { flex: 1; height: 10px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; }
.storage-fill { height: 100%; background: linear-gradient(90deg, var(--blue) 0%, #7c3aed 100%); border-radius: 999px; transition: width 1s ease; }
.storage-pct { font-size: 0.85rem; font-weight: 600; color: #93c5fd; }
.storage-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.78rem; color: var(--text-muted); }

/* ── Files Card ── */
.files-card { grid-column: span 2; }
.file-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.file-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 8px;
    transition: background var(--transition);
}
.file-item:hover { background: var(--surface-2); }
.file-icon { font-size: 1.2rem; }
.file-name { flex: 1; font-size: 0.9rem; }
.file-size { font-size: 0.78rem; color: var(--text-muted); }
.empty-state { color: var(--text-muted); font-size: 0.9rem; text-align: center; padding: 24px 0; }

/* ── Dev Token Info ── */
.dev-card { grid-column: span 2; }
.info-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.info-table tr { border-bottom: 1px solid var(--border); }
.info-table tr:last-child { border: none; }
.info-table td { padding: 10px 8px; }
.info-table td:first-child { color: var(--text-muted); width: 140px; }
.info-table code { color: #a5f3fc; background: rgba(0,0,0,0.25); padding: 3px 7px; border-radius: 5px; }

/* ── Error Page ── */
.error-icon  { font-size: 3rem; margin-bottom: 12px; }
.error-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 12px; color: #fca5a5; }
.error-message { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .dashboard { grid-template-columns: 1fr; }
    .account-card, .files-card, .dev-card { grid-column: span 1; }
    .navbar { padding: 12px 16px; }
}
