/* =================================================================== */
/* --- GLOBAL UI COMPONENTS (Tooltips, Badges, etc.) --- */
/* =================================================================== */

/* --- Holographic Tooltip --- */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s ease;
    vertical-align: middle;
}

.info-tooltip:hover {
    color: #4a90e2;
}

.info-tooltip svg {
    width: 16px;
    height: 16px;
}

/* The Tooltip Bubble */
.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    
    /* Appearance */
    background: rgba(15, 17, 26, 0.95);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    
    /* Sizing & Layout */
    width: max-content;
    max-width: 220px;
    white-space: normal;
    pointer-events: none;
    z-index: 9999;
    
    /* Animation */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.info-tooltip:hover::after {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* --- Helper: Flex Group for Titles + Tooltips --- */
.setting-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.passkey-device-item{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:.95rem;
  color:#fff;
  padding:8px 0;
  border-bottom:1px solid rgba(255,255,255,.05);
}
.passkey-device-item:last-child{border-bottom:none;}
.passkey-device-item .passkey-icon{
  font-size:1.2rem;
  color:#4a90e2;
  flex-shrink:0;
}

.custom-modal-content.tfa-modern-theme{
  background:rgba(21,24,38,.65)!important;
  border:1px solid rgba(255,255,255,.1)!important;
  border-radius:16px!important;
  backdrop-filter:blur(20px)!important;
  box-shadow:0 25px 50px -12px rgba(0,0,0,.5)!important;
  padding:40px 30px!important;
  max-width:400px!important;
  color:#fff;
  text-align:center;
  position:relative;
}

.custom-modal-content.tfa-modern-theme .custom-modal-header,
.custom-modal-content.tfa-modern-theme .custom-modal-footer{
  display:none!important;
}

.custom-modal-content.tfa-modern-theme .custom-modal-body{
  padding:0!important;
}

/* =================================================================== */
/* 2FA MODAL — CANONICAL (Shared by Login + Timeout)                    */
/* =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@400;500;600;700&display=swap');

/* Theme Wrapper for the Modal Content */
.custom-modal-content.tfa-modern-theme,
.pin-modal-container.tfa-modern-theme {
    background: rgba(21, 24, 38, 0.65) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 16px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.50) !important;
    padding: 40px 30px !important;
    max-width: 520px !important;
    color: #fff;
    text-align: center;
    position: relative;
}

/* Hide default header/footer/body structure of the generic modal */
.custom-modal-content.tfa-modern-theme .custom-modal-header,
.custom-modal-content.tfa-modern-theme .custom-modal-footer {
    display: none !important;
}

.custom-modal-content.tfa-modern-theme .custom-modal-body {
    padding: 0 !important;
}

/* --- 2FA Header --- */
.tfa-modal-header h3 {
    margin: 0 0 10px 0;
    font-family: 'Oxanium', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tfa-modal-header p {
    font-family: 'Oxanium', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.70);
    margin: 0 0 28px 0; /* <-- ensures the gap is consistent */
    line-height: 1.5;
}

/* --- Back Button (Top Left) --- */
.tfa-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tfa-back-btn:hover {
    color: #4a90e2;
    transform: translateX(-2px);
}

/* --- Input Group (6 Boxes) --- */
.tfa-input-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
    width: 100%;
}

.tfa-input {
    width: 52px;
    height: 58px;
    background: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 8px;
    color: #fff;
    font-family: 'Oxanium', monospace;
    font-size: 1.55rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    caret-color: #4a90e2;
}

.tfa-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.30);
    transform: translateY(-2px);
    background: rgba(74, 144, 226, 0.05);
}

/* Error State */
.tfa-input-group.error .tfa-input {
    border-color: #ff4444;
    animation: shake 0.4s ease-in-out;
}

/* Success State */
.tfa-input-group.success .tfa-input {
    border-color: #00c851;
    color: #00c851;
}

/* Status Message Text */
.tfa-status-text {
    height: 20px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Oxanium', sans-serif;
}

.tfa-status-text.visible { opacity: 1; }
.tfa-status-text.error { color: #ff4444; }
.tfa-status-text.success { color: #00c851; }

/* Verify Button */
.tfa-verify-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: 'Oxanium', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.35);
}

.tfa-verify-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 26px rgba(74, 144, 226, 0.55);
    transform: translateY(-1px);
}

.tfa-verify-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Shake Animation for Error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- NEW: Modern 2FA Modal Styles (Matches PIN Popup) --- */
/* =================================================================== */

/* Theme Wrapper for the Modal Content */
.custom-modal-content.tfa-modern-theme,
.pin-modal-container.tfa-modern-theme {
    background: rgba(21, 24, 38, 0.65) !important; /* Glassy Dark Blue */
    border: 1px solid rgba(74, 144, 226, 0.3) !important;
    border-radius: 16px !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    padding: 40px 30px !important;
    max-width: 400px !important;
    color: #fff;
    text-align: center;
    position: relative;
}

/* Hide default header/footer/body structure of the generic modal */
.custom-modal-content.tfa-modern-theme .custom-modal-header,
.custom-modal-content.tfa-modern-theme .custom-modal-footer {
    display: none !important; /* We use our own custom layout inside */
}

.custom-modal-content.tfa-modern-theme .custom-modal-body {
    padding: 0 !important;
}

/* --- 2FA Header --- */
.tfa-modal-header h3 {
    margin: 15px 0 10px 0;
    font-family: serif; /* Matches the 'Security Hub Locked' look */
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.tfa-modal-header p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* --- Back Button (Top Left) --- */
.tfa-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.tfa-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateX(-2px);
}

/* --- 6-Digit Input Grid --- */
.tfa-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 25px;
    width: 100%;
}

.tfa-input {
    width: 50px; /* Slightly wider for better touch targets */
    height: 60px;
    font-size: 1.6rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    transition: all 0.2s ease;
    caret-color: #4a90e2;
    outline: none;
    appearance: none; /* Remove default styling */
}

.tfa-input:focus {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.05);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
}

/* Error State */
.tfa-input-group.error {
    animation: tfa-shake 0.4s ease-in-out;
}
.tfa-input-group.error .tfa-input {
    border-color: #f56c6c;
    background: rgba(245, 108, 108, 0.1);
}

/* Success State */
.tfa-input-group.success .tfa-input {
    border-color: #67c23a;
    background: rgba(103, 194, 58, 0.1);
    box-shadow: 0 0 15px rgba(103, 194, 58, 0.3);
}

/* --- Action Buttons --- */
.tfa-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tfa-verify-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #4a90e2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tfa-verify-btn:hover {
    background: #5aa1f2;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.tfa-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Message */
.tfa-status-text {
    height: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
    min-height: 20px;
}
.tfa-status-text.visible { opacity: 1; }
.tfa-status-text.error { color: #f56c6c; }
.tfa-status-text.success { color: #67c23a; }

@keyframes tfa-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}


/* === FIX: 2FA modal spacing (prevents global modal <p> margin resets) === */
.custom-modal-content.tfa-modern-theme .tfa-modal-header p {
    margin: 0 0 30px 0 !important;
}

.tfa-input.active {
    box-shadow: 0 0 0 2px rgba(74,144,226,0.35);
}

