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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f9f9f9;
}

a {
    color: #005ea5;
}

a:hover {
    color: #003d7a;
}

/* ===== Layout ===== */
.site-header {
    background: #1a1a2e;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem
}

.nav-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
}

.nav-links a {
    color: #c8d6e8;
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: #fff;
}

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.site-footer {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.85rem;
    border-top: 1px solid #e5e5e5;
    margin-top: 3rem;
}

/* ===== Typography ===== */
h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
}

p {
    margin-bottom: 0.75rem;
}

.muted {
    color: #888;
    font-style: italic;
}

code {
    font-family: monospace;
    background: #f0f0f0;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* ===== Table ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.table th, .table td {
    padding: 0.6rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f4f4f4;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: #fafafa;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.1em 0.5em;
    border-radius: 3px;
    font-weight: 600;
}

.badge--added {
    background: #d4edda;
    color: #155724;
}

.badge--removed {
    background: #f8d7da;
    color: #721c24;
}

.added {
    color: #155724;
}

.removed {
    color: #721c24;
}

/* ===== Diff ===== */
.diff {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0;
    overflow-x: auto;
    white-space: pre;
}

.diff-added {
    display: block;
    background: #e6ffed;
    color: #24292e;
}

.diff-removed {
    display: block;
    background: #ffeef0;
    color: #24292e;
}

.diff-header {
    display: block;
    background: #f1f8ff;
    color: #005cc5;
    font-weight: 600;
}

.diff-context {
    display: block;
    color: #6a737d;
}

.diff-meta {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== Snapshot ===== */
.snapshot-content {
    font-family: monospace;
    font-size: 0.82rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.meta {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-group input, .form-group select {
    width: 100%;
    max-width: 400px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}

.help-text {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.error {
    color: #c0392b;
    font-size: 0.85rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    background: #005ea5;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    background: #003d7a;
    color: #fff;
}

.btn--danger {
    background: #c0392b;
}

.btn--danger:hover {
    background: #922b21;
}

.btn--small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.btn--secondary {
    background: #6c757d;
}

.btn--secondary:hover {
    background: #545b62;
    color: #fff;
}

.btn--copy {
    background: #6c757d;
    margin-left: 0.5rem;
}

.btn--copy:hover {
    background: #545b62;
    color: #fff;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ===== Messages ===== */
.messages {
    list-style: none;
    margin-bottom: 1.5rem;
}

.message {
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.message--success {
    background: #d4edda;
    color: #155724;
}

.message--error {
    background: #f8d7da;
    color: #721c24;
}

.message--info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

/* ===== Account sub-nav ===== */
.account-subnav {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.75rem;
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 0;
}

.account-subnav a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    color: #555;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.account-subnav a:hover {
    color: #1a1a1a;
    border-bottom-color: #bbb;
}

.account-subnav a.active {
    color: #005ea5;
    font-weight: 600;
    border-bottom-color: #005ea5;
}

/* ===== Auth pages ===== */
.auth-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.auth-form {
    flex: 0 0 380px;
}

.auth-form h1 {
    margin-top: 0;
}

.auth-benefits {
    flex: 1;
}

.auth-benefits h2 {
    margin-top: 0;
}

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
}

.benefits-list li {
    padding: 0.4rem 0 0.4rem 1.75rem;
    position: relative;
}

.benefits-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #155724;
    font-weight: 700;
}

@media (max-width: 700px) {
    .auth-layout {
        flex-direction: column-reverse;
    }

    .auth-form {
        width: 100%;
    }
}

/* Form inputs not wrapped in .form-group (e.g. remaining allauth pages) */
form p {
    margin-bottom: 1rem;
}

form p label {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

form p input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    max-width: 400px;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* ===== allauth panel (MFA index, etc.) ===== */
/* ===== allauth form wrappers ===== */
.allauth-form {
    max-width: 480px;
}

.allauth-form .btn, .allauth-form a {
    margin-top: 0.25rem;
}

/* ===== allauth panel (MFA index, etc.) ===== */
.allauth-panel {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    max-width: 560px;
}

.allauth-panel h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.allauth-panel__body {
    color: #555;
    margin-bottom: 0.75rem;
}

.allauth-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== Definition list ===== */
dl {
    margin: 0.75rem 0;
}

dt {
    font-weight: 600;
    margin-top: 0.5rem;
}

dd {
    margin-left: 1.5rem;
    color: #555;
}
