/* Auth & Account Pages */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding: 60px 20px 80px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    padding: 40px 36px;
}

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

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #656d76;
    margin-bottom: 24px;
}

/* Messages */

.auth-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 18px;
}

.auth-message--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-message--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Form */

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

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

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #24292f;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #24292f;
    background: #f6f8fa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
    background: #fff;
}

/* Buttons */

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #24292f;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #32383f;
}

.auth-btn--secondary {
    background: transparent;
    color: #24292f;
    border: 1px solid #d0d7de;
}

.auth-btn--secondary:hover {
    background: #f6f8fa;
}

.auth-btn--small {
    padding: 5px 12px;
    font-size: 0.78rem;
}

.auth-btn--danger {
    background: #cf222e;
}

.auth-btn--danger:hover {
    background: #a40e26;
}

.auth-footer-text {
    text-align: center;
    font-size: 0.82rem;
    color: #656d76;
    margin-top: 20px;
}

.auth-footer-text a {
    color: #0969da;
    text-decoration: none;
}

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

/* Profile */

.profile-grid {
    display: grid;
    gap: 28px;
    margin-bottom: 28px;
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d8dee4;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.profile-label {
    font-size: 0.85rem;
    color: #656d76;
}

.profile-value {
    font-size: 0.85rem;
    color: #24292f;
    font-weight: 500;
}

.profile-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #d8dee4;
}

/* Badge */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge--role {
    background: #ddf4ff;
    color: #0969da;
}

.badge--positive {
    background: #dafbe1;
    color: #116329;
}

.badge--negative {
    background: #ffebe9;
    color: #82071e;
}

.badge--category {
    background: #f6f8fa;
    color: #656d76;
    border: 1px solid #d0d7de;
}

.badge--spam {
    background: #fff8c5;
    color: #9a6700;
}

/* Security levels */

.security-levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.security-level {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #f6f8fa;
}

.security-level--active {
    border-color: #0969da;
    background: #ddf4ff;
}

.security-level-name {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 80px;
}

.security-level-desc {
    font-size: 0.8rem;
    color: #656d76;
    flex: 1;
}

.security-upgrade-form {
    margin-left: auto;
}

/* TOTP setup */

.totp-setup {
    text-align: center;
    margin-bottom: 20px;
}

.totp-qr {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.totp-qr canvas {
    border-radius: 8px;
}

.totp-manual {
    font-size: 0.82rem;
    color: #656d76;
}

.totp-secret {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 10px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    user-select: all;
}

/* Account panel */

.panel-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 24px;
}

.panel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.panel-stat {
    padding: 16px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    text-align: center;
}

.panel-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #24292f;
}

.panel-stat-label {
    font-size: 0.75rem;
    color: #656d76;
    margin-top: 2px;
}

.panel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.panel-table th,
.panel-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #d8dee4;
}

.panel-table th {
    font-weight: 600;
    color: #656d76;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f6f8fa;
}

.panel-table tr:hover td {
    background: #f6f8fa;
}

.panel-actions {
    display: flex;
    gap: 6px;
}

.panel-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.panel-pagination a {
    padding: 6px 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #24292f;
    text-decoration: none;
}

.panel-pagination a:hover {
    background: #f6f8fa;
}

.panel-pagination a.active {
    background: #24292f;
    color: #fff;
    border-color: #24292f;
}

/* Responsive */

@media (max-width: 640px) {
    .auth-card {
        padding: 28px 20px;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .security-level {
        flex-wrap: wrap;
    }

    .panel-table {
        font-size: 0.78rem;
    }

    .panel-table th,
    .panel-table td {
        padding: 8px 10px;
    }
}
