/* ── 2FA Code Generator ─────────────────────────────────── */
@keyframes tfaFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

body {
    font-family: var(--font-family);
    background: #f1f5f9;
    min-height: 100vh;
    color: var(--text-primary);
    margin: 0; padding: 0; line-height: 1.6;
}
.hidden { display: none !important; }

/* ── Hero ── */

/* ── Page ── */
.tfa-page {
    max-width: 1100px; margin: 0 auto;
    padding: 28px 24px 48px;
    animation: tfaFadeUp 0.35s ease;
}
#alertContainer { margin-bottom: 16px; }
#alertContainer:empty { display: none; }

/* ── Card ── */
.tfa-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px; padding: 28px;
    box-shadow: var(--shadow-sm); margin-bottom: 16px;
}

/* ── Two-panel layout ── */
.tfa-main {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 20px; margin-bottom: 20px;
}
.tfa-panel { display: flex; flex-direction: column; gap: 8px; }

.tfa-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
}

.tfa-textarea {
    width: 100%; height: 220px; padding: 12px 14px;
    border: 1.5px solid var(--border); border-radius: 10px;
    font-size: 13px; font-family: 'Courier New', monospace;
    background: #f8fafc; color: var(--text-primary);
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box; outline: none; line-height: 1.7;
}
.tfa-textarea:focus {
    border-color: var(--primary); background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.tfa-textarea--readonly {
    background: #f8fafc; cursor: default;
    color: #1e293b; font-weight: 600; letter-spacing: 0.5px;
}

.tfa-info {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 12px; color: var(--text-muted); line-height: 1.5;
    padding: 8px 10px; background: #f8fafc;
    border-radius: 8px; border: 1px solid #e8edf2;
}
.tfa-info svg { flex-shrink: 0; margin-top: 1px; }

/* ── Codes list (JS-rendered) ── */
.codes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 20px;
}

/* ── Copy button ── */
.btn, .btn-copy-all, #copyAllBtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 10px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.15s, transform 0.15s;
    width: 100%;
}
.btn:hover, .btn-copy-all:hover, #copyAllBtn:hover {
    background: var(--primary-dark, #4f46e5);
    transform: translateY(-1px);
}

/* ── Alerts ── */
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px 18px; font-size: 13px; margin-bottom: 12px; }
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; border-radius: 10px; padding: 14px 18px; font-size: 13px; margin-bottom: 12px; }
.alert-info    { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; border-radius: 10px; padding: 14px 18px; font-size: 13px; margin-bottom: 12px; }

/* ── Footer ── */
.tfa-footer { border-top: 1px solid #e2e8f0; padding-top: 24px; margin-top: 8px; text-align: center; }
.tfa-footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 12px; }
.tfa-footer-links a {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; color: var(--text-muted); text-decoration: none; transition: color 0.15s;
}
.tfa-footer-links a:hover { color: var(--primary); }
.tfa-footer-copy { font-size: 12px; color: var(--text-muted); margin: 0; }

@media (max-width: 640px) {
    .tfa-page { padding: 20px 16px 40px; }
    .tfa-main { grid-template-columns: 1fr; }
    .tfa-card { padding: 20px 16px; }
}
