:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --bg-alt: #f8f9fa;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg-alt);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.topbar a.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}

.topbar .brand img { width: 26px; height: 26px; object-fit: contain; }

main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 36px 32px;
}

.auth-card.wide { max-width: 640px; }

.auth-card h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 0 0 8px;
}

.auth-card p.subtitle {
    color: var(--text-secondary);
    margin: 0 0 24px;
    font-size: 0.92rem;
}

.form-grid { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label { font-size: 0.85rem; font-weight: 600; }

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-block { width: 100%; }

.btn-link-plain {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.88rem;
    padding: 0;
    text-decoration: underline;
}

.auth-inline-form { margin-top: 10px; }

.auth-footer-link {
    margin: 16px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.auth-footer-link a { color: var(--primary); text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 18px;
}

.alert-success { background: #e6f4ea; color: #137333; border: 1px solid #c2e7c9; }
.alert-error { background: #fce8e6; color: #c5221f; border: 1px solid #fad2cf; }

/* Consent screen */
.consent-client { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.consent-client .client-badge {
    width: 48px; height: 48px; border-radius: 10px; background: var(--bg-alt);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-weight: 700; color: var(--primary); font-size: 1.2rem;
}
.consent-scope-list { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 8px; }
.consent-scope-list li { font-size: 0.9rem; color: var(--text-secondary); padding-left: 22px; position: relative; }
.consent-scope-list li::before { content: "✓"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.consent-actions { display: flex; gap: 12px; }
.consent-actions form { flex: 1; }

/* Account page */
.account-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.account-avatar {
    width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-family: var(--font-heading);
    font-weight: 700; font-size: 1.3rem;
}
.account-name { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.account-email { color: var(--text-secondary); font-size: 0.88rem; }

.services-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.services-table th, .services-table td {
    text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem;
}
.services-table th { color: var(--text-secondary); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.services-table a { color: var(--primary); text-decoration: none; }
.services-table a:hover { text-decoration: underline; }
.empty-state { color: var(--text-secondary); font-size: 0.9rem; padding: 20px 0; text-align: center; }
