/**
 * Bundler — Login + Dashboard styling
 *
 * Scoped to bundler-only classes (.bundler-login-page, .bundler-recent-bundles, etc.)
 * so it can be loaded alongside admin.css without overriding shared chrome.
 */

/* ── Login page ─────────────────────────────────────────────── */

body.bundler-login-page {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse at top left, rgba(13, 148, 136, 0.18), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(15, 23, 42, 0.5), transparent 55%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0D9488 130%);
    color: #fff;
}

.bundler-login-card {
    width: 100%;
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    background: #fff;
    color: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
}

.bundler-login-rail {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: linear-gradient(160deg, #0D9488 0%, #0f766e 60%, #134e4a 100%);
    color: #fff;
    min-height: 100%;
}

.bundler-login-rail svg {
    max-width: 240px;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
}

.bundler-login-form {
    padding: 3rem 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bundler-login-header {
    margin-bottom: 1.75rem;
}

.bundler-login-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-bottom: 1.5rem;
}

.bundler-login-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0D9488;
    margin-bottom: 0.4rem;
}

.bundler-login-form h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.bundler-login-subtitle {
    color: #64748b;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.bundler-login-form .form-group {
    margin-bottom: 1rem;
}

.bundler-login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.bundler-login-form input[type="email"],
.bundler-login-form input[type="password"] {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bundler-login-form input[type="email"]:focus,
.bundler-login-form input[type="password"]:focus {
    outline: none;
    border-color: #0D9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.bundler-login-form .btn-full {
    width: 100%;
}

.bundler-login-form .login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: #94a3b8;
    font-size: 0.8rem;
}

.bundler-login-form .login-divider::before,
.bundler-login-form .login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.bundler-login-form .alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.bundler-login-form .login-footer {
    margin-top: 0.5rem;
    text-align: center;
}

.bundler-login-form .login-footer a {
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
}

.bundler-login-form .login-footer a:hover {
    color: #0D9488;
    text-decoration: underline;
}

@media (max-width: 720px) {
    .bundler-login-card {
        grid-template-columns: 1fr;
    }
    .bundler-login-rail {
        min-height: 160px;
        padding: 1.5rem;
    }
    .bundler-login-rail svg {
        max-width: 160px;
    }
    .bundler-login-form {
        padding: 2rem 1.5rem;
    }
}

/* ── Dashboard page ─────────────────────────────────────────── */

.bundler-dashboard-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bundler-recent-bundles {
    margin-top: 2rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem 1.5rem;
}

.bundler-recent-bundles .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.bundler-recent-bundles h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.bundler-recent-bundles .link-muted {
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
}

.bundler-recent-bundles .link-muted:hover {
    color: #0D9488;
}

.bundler-recent-bundles .empty-state {
    padding: 2rem 0;
    text-align: center;
    color: #64748b;
}

.bundler-recent-bundles .empty-state p {
    margin: 0 0 1rem;
}

/* ── Settings page ─────────────────────────────────────────── */

.bundler-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.bundler-settings-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem 1.5rem;
}

.bundler-settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: #0D9488;
}

.bundler-settings-card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
}

.bundler-settings-meta {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    font-size: 0.9rem;
}

.bundler-settings-meta dt {
    color: #64748b;
    font-weight: 500;
}

.bundler-settings-meta dd {
    margin: 0;
    color: #0f172a;
}

.bundler-settings-card .form-group {
    margin-bottom: 0.9rem;
}

.bundler-settings-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.bundler-settings-card input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bundler-settings-card input[type="password"]:focus {
    outline: none;
    border-color: #0D9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.bundler-settings-status {
    margin: 0.4rem 0 0.6rem;
    font-size: 0.85rem;
    min-height: 1.1em;
    color: #64748b;
}

.bundler-settings-status-success {
    color: #15803d;
}

.bundler-settings-status-error {
    color: #b91c1c;
}

.bundler-passkey-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.bundler-passkey-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.88rem;
}

.bundler-passkey-info strong {
    color: #0f172a;
    font-weight: 600;
}

.bundler-passkey-meta {
    color: #64748b;
    font-size: 0.75rem;
}

.bundler-passkey-delete {
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    padding: 0.35rem;
}

.bundler-passkey-delete:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.btn-passkey {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: #0D9488;
    color: #fff;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-passkey:hover {
    background: #0f766e;
}

/* Status pills — match bundler.css palette so list-page and dashboard agree */
.status-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-pill-draft    { background: #f1f5f9; color: #475569; }
.status-pill-merging  { background: #fef3c7; color: #92400e; }
.status-pill-ready    { background: #dcfce7; color: #166534; }
.status-pill-failed   { background: #fee2e2; color: #991b1b; }
.status-pill-archived { background: #e2e8f0; color: #475569; }
