/* ================================================================
   Yeap Two-Factor Auth — Frontend (security panel + challenge)
   ================================================================ */

/* ---------------------------------------------------------------
   Panel wrapper
   --------------------------------------------------------------- */
.ytfa-panel {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 780px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* ---------------------------------------------------------------
   Panel header
   --------------------------------------------------------------- */
.ytfa-panel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.ytfa-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* ---------------------------------------------------------------
   Badges
   --------------------------------------------------------------- */
.ytfa-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .4px;
}
.ytfa-badge--on       { background: #dcfce7; color: #15803d; }
.ytfa-badge--off      { background: #f1f5f9; color: #64748b; }
.ytfa-badge--required { background: #fee2e2; color: #b91c1c; }

/* ---------------------------------------------------------------
   Tabs
   --------------------------------------------------------------- */
.ytfa-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    overflow-x: auto;
}
.ytfa-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.ytfa-tab:hover           { color: #1a56db; }
.ytfa-tab--active         { color: #1a56db; border-bottom-color: #1a56db; }
.ytfa-tab-badge {
    display: inline-block;
    margin-left: 6px;
    background: #1a56db;
    color: #fff;
    border-radius: 20px;
    font-size: 11px;
    padding: 1px 7px;
}

/* ---------------------------------------------------------------
   Tab content
   --------------------------------------------------------------- */
.ytfa-tab-content         { display: none; padding: 24px; }
.ytfa-tab-content--active { display: block; }

/* ---------------------------------------------------------------
   Sections inside tabs
   --------------------------------------------------------------- */
.ytfa-section { margin-bottom: 24px; }
.ytfa-section h4 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}
.ytfa-section h5 {
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ---------------------------------------------------------------
   Descriptions
   --------------------------------------------------------------- */
.ytfa-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
    line-height: 1.5;
}
.ytfa-desc--success { color: #15803d; }
.ytfa-desc--warn    { color: #b45309; }
.ytfa-desc--info    { color: #1d4ed8; }
.ytfa-desc--muted   { color: #9ca3af; }

/* ---------------------------------------------------------------
   Notices (panel messages)
   --------------------------------------------------------------- */
.ytfa-notice {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin: 0 24px 16px;
}
.ytfa-notice--success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.ytfa-notice--error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.ytfa-notice--info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.ytfa-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
    text-decoration: none;
    line-height: 1.4;
}
.ytfa-btn--primary {
    background: #1a56db;
    color: #fff;
    border-color: #1a56db;
}
.ytfa-btn--primary:hover { background: #1e40af; border-color: #1e40af; color: #fff; }
.ytfa-btn--secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
.ytfa-btn--secondary:hover { background: #e2e8f0; color: #1e293b; }
.ytfa-btn--danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.ytfa-btn--danger:hover { background: #b91c1c; }
.ytfa-btn--outline-danger {
    background: #fff;
    color: #dc2626;
    border-color: #dc2626;
}
.ytfa-btn--outline-danger:hover { background: #fee2e2; }
.ytfa-btn--small { padding: 5px 10px; font-size: 12px; }

/* ---------------------------------------------------------------
   Form inputs
   --------------------------------------------------------------- */
.ytfa-input {
    width: 100%;
    max-width: 340px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.ytfa-input:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
}
.ytfa-input--code {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    max-width: 220px;
}
.ytfa-phone-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* ---------------------------------------------------------------
   Method chooser cards
   --------------------------------------------------------------- */
.ytfa-method-chooser {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.ytfa-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    min-width: 130px;
    text-align: center;
    transition: border-color .15s, background .15s;
}
.ytfa-method-card input[type="radio"] { display: none; }
.ytfa-method-card:hover,
.ytfa-method-card--selected {
    border-color: #1a56db;
    background: #eff6ff;
}
.ytfa-method-icon { font-size: 28px; }
.ytfa-method-label { font-weight: 700; font-size: 14px; color: #1e293b; }
.ytfa-method-desc  { font-size: 12px; color: #64748b; }
.ytfa-method-chooser--compact .ytfa-method-card {
    flex-direction: row;
    min-width: auto;
    padding: 10px 16px;
    gap: 8px;
}

/* ---------------------------------------------------------------
   Status row (when 2FA enabled)
   --------------------------------------------------------------- */
.ytfa-status-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 20px;
}
.ytfa-status-icon { font-size: 20px; }
.ytfa-status-icon--on { color: #15803d; }
.ytfa-method-label-small { font-size: 13px; color: #64748b; }

/* ---------------------------------------------------------------
   Enable row
   --------------------------------------------------------------- */
.ytfa-enable-row { margin-top: 20px; }

/* ---------------------------------------------------------------
   Disable row / danger zone
   --------------------------------------------------------------- */
.ytfa-danger-zone {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #fee2e2;
}
.ytfa-disable-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

/* ---------------------------------------------------------------
   Verify form
   --------------------------------------------------------------- */
.ytfa-verify-form {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   Backup codes grid
   --------------------------------------------------------------- */
.ytfa-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 2px;
}
.ytfa-backup-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }

/* ---------------------------------------------------------------
   Devices table
   --------------------------------------------------------------- */
.ytfa-devices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ytfa-devices-table th,
.ytfa-devices-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.ytfa-devices-table th { background: #f8fafc; font-weight: 700; color: #1e293b; }

/* ---------------------------------------------------------------
   Activity table
   --------------------------------------------------------------- */
.ytfa-activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ytfa-activity-table th,
.ytfa-activity-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.ytfa-activity-table th { background: #f8fafc; font-weight: 700; color: #1e293b; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 600px) {
    .ytfa-panel__header  { flex-wrap: wrap; }
    .ytfa-tab            { padding: 10px 12px; font-size: 13px; }
    .ytfa-tab-content    { padding: 16px; }
    .ytfa-method-chooser { flex-direction: column; }
    .ytfa-input          { max-width: 100%; }
    .ytfa-phone-row      { flex-direction: column; align-items: flex-start; }
    .ytfa-disable-row    { flex-direction: column; align-items: flex-start; }
    .ytfa-devices-table  { display: block; overflow-x: auto; }
    .ytfa-activity-table { display: block; overflow-x: auto; }
}
