*, *:before, *:after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: #f2f2f2;
    background-color: #1a1a1a;
    background-image: linear-gradient(to bottom, #181818 0%, #1a1a1a 100%);
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.site-header {
    width: 100%;
    margin: 0;
    padding: 14px 4%;
    color: #fff;
    background-color: #2b2b2b;
    border-bottom: 2px solid #555;
    background-image: linear-gradient(to bottom, #3b3b3b, #1e1e1e);
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header-title {
    margin: 0;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px #000;
    font-weight: normal;
}

.header-nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.header-nav a {
    color: #a7c7ff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.header-nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.site-main {
    width: 100%;
    margin: 0;
    padding: 12px 4%;
    min-height: calc(100vh - 140px);
}

.content-container {
    background-color: #1e1e1e;
    max-width: 1200px;
    margin: 14px auto;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 0 16px rgba(0,0,0,0.6);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.container-small {
    max-width: 500px;
}

.panel-inset {
    margin: 0 0 20px 0;
    padding: 20px;
    border: 1px solid #444;
    background-color: #242424;
    border-radius: 8px;
    box-shadow: inset 2px 2px 5px #0e0e0e, inset -2px -2px 5px #2e2e2e;
    background-image: linear-gradient(145deg, #2e2e2e, #1c1c1c);
}

h1, h2, h3 { font-weight: normal; margin: 0; }

h2 {
    font-size: 1.55em;
    margin: 0 0 0.7em 0;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    line-height: 1.3;
}

.section-header {
    margin: 20px 0 10px 0;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1em;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.form-card {
    background-color: #1e1e1e;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
    box-shadow: 0 0 16px rgba(0,0,0,0.6);
    padding: 30px;
}

.form-card h2 {
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #aaa;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #f2f2f2;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 5px;
    box-shadow: inset 1px 1px 3px #0a0a0a;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #0066cc;
}

.form-group input::placeholder {
    color: #555;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.btn-primary {
    background: linear-gradient(to bottom, #0066cc, #004499);
    color: white;
    border: 1px solid #003366;
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #0055aa, #003377);
}

.btn-secondary {
    background: linear-gradient(to bottom, #444, #333);
    color: #ddd;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background: linear-gradient(to bottom, #555, #444);
}

.btn-danger {
    background: linear-gradient(to bottom, #cc3333, #992222);
    color: white;
    border: 1px solid #661111;
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #bb2222, #881111);
}

.btn-success {
    background: linear-gradient(to bottom, #228822, #006600);
    color: white;
    border: 1px solid #004400;
}

.btn-success:hover {
    background: linear-gradient(to bottom, #117711, #005500);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

.alert {
    padding: 14px 18px;
    border-radius: 5px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid;
}

.alert-error {
    background: #2a1515;
    border-color: #442222;
    color: #ff6666;
}

.alert-success {
    background: #152a15;
    border-color: #224422;
    color: #66cc66;
}

.alert-warning {
    background: #2a2215;
    border-color: #443322;
    color: #ccaa66;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    padding: 20px;
    border: 1px solid #444;
    background-color: #242424;
    border-radius: 8px;
    box-shadow: inset 2px 2px 5px #0e0e0e, inset -2px -2px 5px #2e2e2e;
    background-image: linear-gradient(145deg, #2e2e2e, #1c1c1c);
}

.info-card h3 {
    margin: 0 0 15px 0;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a2a;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    color: #888;
}

.info-row .value {
    color: #f2f2f2;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.status-badge.verified {
    background: linear-gradient(to bottom, #228822, #006600);
}

.status-badge.unverified {
    background: linear-gradient(to bottom, #666, #444);
}

.status-badge.enabled {
    background: linear-gradient(to bottom, #228822, #006600);
}

.status-badge.disabled {
    background: linear-gradient(to bottom, #cc3333, #992222);
}

.settings-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

.settings-nav {
    padding: 15px;
    border: 1px solid #444;
    background-color: #242424;
    border-radius: 8px;
    box-shadow: inset 2px 2px 5px #0e0e0e, inset -2px -2px 5px #2e2e2e;
    background-image: linear-gradient(145deg, #2e2e2e, #1c1c1c);
    height: fit-content;
}

.settings-nav h3 {
    margin: 0 0 12px 0;
    color: #888;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.settings-nav li {
    margin-bottom: 4px;
}

.settings-nav a {
    display: block;
    padding: 8px 12px;
    color: #ccc;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.settings-nav a:hover {
    background: rgba(255,255,255,0.05);
}

.settings-nav a.active {
    background: rgba(0, 102, 204, 0.3);
    color: #6af;
}

.settings-content {
    padding: 20px;
    border: 1px solid #444;
    background-color: #242424;
    border-radius: 8px;
    box-shadow: inset 2px 2px 5px #0e0e0e, inset -2px -2px 5px #2e2e2e;
    background-image: linear-gradient(145deg, #2e2e2e, #1c1c1c);
}

.settings-section h2 {
    margin: 0 0 20px 0;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.totp-secret-large {
    display: block;
    background: #1a1a1a;
    border: 1px solid #444;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 1.1em;
    color: #6af;
    letter-spacing: 2px;
    text-align: center;
    box-shadow: inset 1px 1px 3px #0a0a0a;
}

.backup-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin: 15px 0;
}

.backup-code {
    display: block;
    background: #1a1a1a;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    text-align: center;
    color: #6af;
    box-shadow: inset 1px 1px 3px #0a0a0a;
}

.text-center { text-align: center; }
.text-muted { color: #888; }

code {
    background: #1a1a1a;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
    color: #6af;
}

.site-footer {
    width: 100%;
    padding: 20px 4%;
    background: #151515;
    border-top: 1px solid #2a2a2a;
    text-align: center;
    color: #555;
    font-size: 13px;
}

@media (max-width: 600px) {
    .header-title {
        font-size: 1.4em;
    }

    .form-card,
    .panel-inset,
    .info-card,
    .settings-content {
        padding: 15px;
    }
}

