
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --brand: #0257d6;
    --brand-dark: #0148b3;
    --brand-light: #e8f0fe;
    --brand-glow: rgba(2, 87, 214, 0.2);

    --dark: #111827;
    --dark-soft: #1f2937;
    --text: #374151;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    --bg: #f3f4f6;
    --white: #ffffff;

    --green: #059669;
    --green-light: #ecfdf5;
    --green-text: #065f46;

    --red-bg: #fef2f2;
    --red-text: #991b1b;

    --amber-bg: #fffbeb;
    --amber-text: #92400e;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}


/* ── Layout ── */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-topbar {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-topbar-logo img {
    height: 34px;
}

.auth-topbar-link {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.15s;
}

.auth-topbar-link:hover {
    background: var(--white);
    color: var(--text);
}

.auth-topbar-link:link,
.auth-topbar-link:visited {
    color: var(--text-light);
}

.auth-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px 60px;
}


/* ── Card ── */

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 480px;
    animation: fadeUp 0.35s ease-out;
}

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

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


/* ── Logo inside card ── */

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-logo img {
    height: 40px;
}


/* ── Headings ── */

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 28px;
}


/* ── Google button ── */

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.google-btn:hover {
    border-color: var(--border-hover);
    background: #fafafa;
    box-shadow: var(--shadow);
}

.google-btn:link,
.google-btn:visited {
    color: var(--text);
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}


/* ── Divider ── */

.auth-divider {
    display: flex;
    align-items: center;
    margin: 22px 0;
    gap: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}


/* ── Form ── */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-soft);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--dark);
    background: var(--white);
    transition: all 0.15s;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:hover {
    border-color: var(--border-hover);
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.turnstile-group {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
    min-height: 65px;
}


/* ── Buttons ── */

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-brand {
    background: var(--brand);
    color: var(--white);
}

.btn-brand:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--brand-glow);
}

.btn:disabled,
.btn:disabled:hover {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-brand:link,
.btn-brand:visited {
    color: var(--white);
}

.btn-dark {
    background: #111827;
    color: var(--white);
}

.btn-dark:hover {
    background: #1f2937;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-dark:link,
.btn-dark:visited {
    color: var(--white);
}

.btn-jira {
    background: #0052cc;
    color: var(--white);
}

.btn-jira:hover {
    background: #0040a0;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 82, 204, 0.25);
}

.btn-jira:link,
.btn-jira:visited {
    color: var(--white);
}

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

.btn-outline:hover {
    border-color: var(--border-hover);
    background: var(--bg);
}

.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn {
    flex: 1;
}

.btn-row .btn-outline {
    flex: 0 0 auto;
    width: auto;
    padding: 13px 22px;
}


/* ── Messages ── */

.auth-error {
    background: var(--red-bg);
    color: var(--red-text);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.auth-error div + div {
    margin-top: 4px;
}

.auth-status-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
}

.auth-status-icon i {
    font-size: 24px;
}

.auth-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--brand-light);
    color: var(--text);
    border-radius: var(--radius);
    padding: 13px 14px;
    margin-bottom: 22px;
    font-size: 13px;
    line-height: 1.5;
}

.auth-note i {
    color: var(--brand);
    margin-top: 2px;
    flex-shrink: 0;
}


/* ── Footer links ── */

.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.auth-footer-center {
    text-align: center;
    margin-top: 20px;
}

.auth-link {
    font-size: 14px;
    color: var(--text-light);
}

.auth-link a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.auth-link a:link,
.auth-link a:visited {
    color: var(--brand);
}

.auth-link-muted {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.auth-link-muted:hover {
    color: var(--text);
}

.auth-link-muted:link,
.auth-link-muted:visited {
    color: var(--text-muted);
}


/* ══════════════════════════
   Onboarding-specific
   ══════════════════════════ */

/* ── Progress bar ── */

.progress-bar {
    display: flex;
    align-items: center;
    margin-bottom: 36px;
    padding: 0 16px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: var(--white);
    transition: all 0.3s;
    flex-shrink: 0;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 10px;
    position: relative;
    overflow: hidden;
}

.progress-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: var(--brand);
    transition: width 0.4s ease;
}

.progress-step.active .step-dot {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
    box-shadow: 0 0 0 4px var(--brand-glow);
}

.progress-step.active .step-label {
    color: var(--dark);
    font-weight: 600;
}

.progress-step.done .step-dot {
    border-color: var(--green);
    background: var(--green);
    color: var(--white);
}

.progress-step.done .step-label {
    color: var(--green-text);
}

.progress-line.done::after {
    width: 100%;
}


/* ── Onboarding cards (reuse .auth-card) ── */

.onboard-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    width: 100%;
    max-width: 640px;
    display: none;
    animation: fadeUp 0.35s ease-out;
}

.onboard-card.active {
    display: block;
}


/* ── Welcome features ── */

.welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.welcome-icon i {
    font-size: 24px;
    color: var(--brand);
}

.onboard-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.onboard-desc {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 28px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 13px 15px;
    border-radius: var(--radius);
    background: var(--bg);
    transition: background 0.15s;
}

.feature-item:hover {
    background: var(--brand-light);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 15px;
}

.feature-icon.purple { background: #ede9fe; color: #6d28d9; }
.feature-icon.teal { background: #e0f2fe; color: #0369a1; }
.feature-icon.amber { background: #fef3c7; color: #d97706; }

.feature-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.feature-text span {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}


/* ── Integration headers ── */

.integration-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.integration-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.integration-logo.github { background: #111827; color: #fff; }
.integration-logo.jira { background: #0052cc; color: #fff; }

.scopes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
}

.scope-tag {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 11px;
    border-radius: 20px;
    background: var(--bg);
    color: var(--text);
}

.connected-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--green-light);
    margin-bottom: 24px;
}

.connected-badge i {
    font-size: 18px;
    color: var(--green);
}

.connected-badge span {
    font-size: 14px;
    font-weight: 600;
    color: var(--green-text);
}


/* ── Finish ── */

.finish-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.finish-icon i {
    font-size: 28px;
    color: var(--green);
}

.finish-text {
    text-align: center;
    margin-bottom: 24px;
}

.finish-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-radius: 8px;
    background: var(--bg);
}

.summary-item .label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.summary-item .status {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.status.connected { background: var(--green-light); color: var(--green-text); }
.status.skipped { background: var(--amber-bg); color: var(--amber-text); }


/* ── Responsive ── */

@media (max-width: 560px) {
    .auth-topbar {
        padding: 16px 20px;
    }

    .auth-card,
    .onboard-card {
        padding: 32px 24px;
    }

    .auth-title,
    .onboard-title {
        font-size: 21px;
    }

    .step-label {
        display: none;
    }

    .progress-bar {
        padding: 0;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row .btn-outline {
        width: 100%;
    }

    .auth-footer {
        flex-direction: column;
        gap: 10px;
    }
}
