/**
 * Credential Hub - Modal & Overlay Styles
 * Bitwarden item modal, auth overlay, profile dropdown, and form dialogs.
 */

/* BITWARDEN 1:1 MODAL WINDOW STYLES */
.bw-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: bwFadeIn 0.2s ease-out;
}

@keyframes bwFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.bw-modal-dialog {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 25px rgba(56, 189, 248, 0.15);
    overflow: hidden;
}

.bw-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #090e17;
}

.bw-modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bw-modal-title-group h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.bw-fav-star-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.bw-fav-star-btn:hover, .bw-fav-star-btn.active {
    color: #fbbf24;
}

.bw-modal-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.bw-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.bw-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* BITWARDEN MODAL CARDS */
.bw-detail-card {
    background: #182234;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bw-detail-card-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #94a3b8;
    margin-bottom: 2px;
}

.bw-detail-header-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bw-detail-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.bw-detail-header-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.bw-detail-folder-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

/* FLATTENED READ-ONLY FIELD ROWS */
.bw-field-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bw-field-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bw-field-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.bw-field-value-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bw-field-value-text {
    font-size: 14px;
    color: #f8fafc;
    font-weight: 500;
    word-break: break-all;
}

.bw-field-value-text.mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 0.5px;
}

.bw-field-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bw-field-action-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.bw-field-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #38bdf8;
}

.bw-field-action-btn .material-icons {
    font-size: 16px;
}

/* EDITABLE FORM INPUTS INSIDE MODAL */
.bw-edit-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.bw-edit-group:last-child {
    margin-bottom: 0;
}

.bw-edit-group label {
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

.bw-input-with-actions {
    position: relative;
    display: flex;
    align-items: center;
}

.bw-input-with-actions .form-input {
    padding-right: 70px;
}

.bw-input-icon-actions {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* MODAL FOOTER */
.bw-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #090e17;
}

.bw-modal-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bw-btn-blue {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bw-btn-blue:hover {
    background: #1d4ed8;
}

.bw-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 7px 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bw-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.bw-icon-danger-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.bw-icon-danger-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* AUTH OVERLAY */
.aquax-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #060b11;
    background-image: 
        radial-gradient(at 50% 10%, rgba(139, 92, 246, 0.22) 0px, transparent 60%),
        radial-gradient(at 10% 90%, rgba(167, 139, 250, 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(99, 102, 241, 0.12) 0px, transparent 50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.aquax-auth-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.bw-auth-topbar {
    width: 100%;
    padding: 20px 32px;
    display: flex;
    align-items: center;
}

.bw-auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bw-auth-brand .bw-shield-icon {
    font-size: 26px;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.25);
}

.bw-auth-brand .bw-brand-text {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.bw-auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 40px 20px;
}

.bw-auth-card {
    width: 100%;
    max-width: 440px;
    background: #0d151f;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    animation: bwCardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bwCardFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.bw-auth-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.bw-vault-safe-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #4c1d95, #1e1b4b);
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bw-vault-safe-icon span {
    font-size: 34px;
    color: #a78bfa;
}

.bw-waving-hand-icon {
    width: 68px;
    height: 68px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    animation: bwWavingHand 2s infinite ease-in-out;
}

@keyframes bwWavingHand {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(14deg); }
    40% { transform: rotate(-8deg); }
    60% { transform: rotate(14deg); }
    80% { transform: rotate(-4deg); }
}

.bw-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #f8fafc;
    text-align: center;
    margin: 0 0 20px 0;
    letter-spacing: -0.4px;
}

.bw-auth-subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 13.5px;
    font-weight: 500;
    margin-top: -12px;
    margin-bottom: 24px;
    word-break: break-all;
}

.bw-auth-form {
    display: flex;
    flex-direction: column;
}

.bw-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.bw-input-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: #cbd5e1;
}

.bw-input-group label .req {
    color: #ef4444;
}

.bw-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.bw-input-wrapper .bw-input {
    width: 100%;
    padding: 11px 40px 11px 40px;
    background: #070d14;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.bw-input-wrapper .bw-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    background: #0d0a18;
}

.bw-input-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 18px;
    pointer-events: none;
}

.bw-password-eye {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.bw-password-eye:hover {
    color: #cbd5e1;
}

.bw-password-eye .material-icons {
    font-size: 18px;
}

.bw-checkbox-group {
    margin-bottom: 20px;
}

.bw-checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #cbd5e1;
    user-select: none;
}

.bw-checkbox-container input {
    accent-color: #8b5cf6;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.bw-hint-row {
    margin-top: -8px;
    margin-bottom: 18px;
    text-align: right;
}

.bw-hint-row a {
    color: #a78bfa;
    font-size: 12.5px;
    text-decoration: none;
}

.bw-hint-row a:hover {
    text-decoration: underline;
}

.bw-auth-error-msg {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 12.5px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: center;
}

.bw-btn-primary {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: 1px solid #8b5cf6;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    transition: all 0.2s ease;
}

.bw-btn-primary:hover {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

.bw-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 22px 0;
    color: #475569;
    font-size: 12px;
}

.bw-divider::before,
.bw-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bw-divider span {
    padding: 0 12px;
}

.bw-secondary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bw-secondary-actions .bw-btn-secondary {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.bw-secondary-actions .bw-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
}

.bw-secondary-actions .bw-btn-secondary .material-icons {
    font-size: 16px;
    color: #60a5fa;
}

.bw-auth-footer-link {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

.bw-auth-footer-link a,
.bw-create-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
}

.bw-auth-footer-link a:hover,
.bw-create-link:hover {
    text-decoration: underline;
}

.bw-auth-page-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bw-auth-page-footer .highlight {
    color: #60a5fa;
    font-weight: 500;
}

.bw-domain-shield-badge {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.2s ease;
}

.bw-domain-shield-badge.aquax-green {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.bw-domain-shield-badge.credential-purple {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.bw-domain-shield-badge .material-icons {
    font-size: 14px;
}

/* PROFILE DROPDOWN MENU */
.bw-header-actions {
    position: relative !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bw-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    padding: 8px 0;
    z-index: 10000;
    animation: bwFadeInDown 0.15s ease-out;
}

@keyframes bwFadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bw-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
}

.bw-dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bw-dropdown-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bw-dropdown-sub {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.2;
}

.bw-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bw-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0;
}

.bw-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.bw-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bw-dropdown-item .material-icons {
    font-size: 18px;
    color: #94a3b8;
    transition: color 0.12s ease;
}

.bw-dropdown-item:hover .material-icons {
    color: #ffffff;
}

/* ==========================================================================
   JUSTSHOP EMBED PRODUCT DETAILS & CHECKOUT MODAL WINDOW
   ========================================================================== */

.justshop-embed-modal-dialog {
    background: #121316;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.95), 0 0 40px rgba(34, 197, 94, 0.15);
    overflow: hidden;
    color: #e5e7eb;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.justshop-modal-header {
    flex-shrink: 0;
    background: #1a1b20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.justshop-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.justshop-modal-layout {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

@media (max-width: 820px) {
    .justshop-modal-layout {
        flex-direction: column;
    }
    .justshop-checkout-col {
        width: 100% !important;
    }
}

.justshop-product-col {
    flex: 1;
    min-width: 0;
}

.justshop-checkout-col {
    width: 340px;
    flex-shrink: 0;
    background: #1a1b20;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.justshop-checkout-header {
    background: #22242c;
    padding: 12px 18px;
    font-size: 13.5px;
    font-weight: 700;
    color: #e5e7eb;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.justshop-interval-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 16px;
    gap: 4px;
}

.justshop-interval-btn {
    flex: 1;
    padding: 7px 10px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    color: #9ca3af;
    text-align: center;
}

.justshop-interval-btn:hover {
    color: #ffffff;
}

.justshop-interval-btn.active {
    background: #22c55e;
    color: #052e16;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.justshop-checkout-body {
    padding: 18px;
}

.justshop-gw-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.justshop-gw-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
}

.justshop-gw-card.active {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

.justshop-gw-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
}

.justshop-gw-pill {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
}

.justshop-modal-footer {
    flex-shrink: 0;
    background: #1a1b20;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #6b7280;
    font-size: 12px;
}

.bw-card-icons-inline {
    display: flex;
    align-items: center;
    gap: 3px;
}

.bw-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    border-radius: 3px;
    padding: 2px 4px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

.bw-card-badge.visa { background: #1a1f71; }
.bw-card-badge.mc { background: #eb001b; }
.bw-card-badge.discover { background: #ff6000; }
.bw-card-badge.amex { background: #007bc1; }
.bw-card-badge.jcb { background: #0e4c92; }
.bw-card-badge.diners { background: #004a97; }
.bw-card-badge.unionpay { background: #d92128; }

/* ==========================================================================
   AUTHENTICATOR TAB & TOTP ENTRY CARDS (1:1 with Authenticator Extension)
   ========================================================================== */
.auth-entry-card {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: left !important;
    width: 100%;
    box-sizing: border-box;
    background: #0b0f14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
    transition: border-color 0.2s ease, box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
    user-select: none;
}

.auth-entry-card:hover {
    background: #111822;
    border-color: rgba(192, 132, 252, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.auth-entry-card.active-outline,
.auth-entry-card:focus-within {
    border-color: #c084fc;
}

.auth-entry-card.pinned {
    border-left: 4px solid #38bdf8;
}

#authAccountsList {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

#authAccountsList::-webkit-scrollbar {
    width: 6px;
}
#authAccountsList::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}
#authAccountsList::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
#authAccountsList::-webkit-scrollbar-thumb:hover {
    background: rgba(192, 132, 252, 0.4);
}

.auth-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.auth-card-issuer-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-issuer-name {
    font-size: 15.5px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: 0.2px;
}

.auth-pinned-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-card-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    transition: all 0.15s ease;
}

.auth-card-btn svg {
    display: block;
    fill: currentColor;
    transition: transform 0.15s ease, fill 0.15s ease;
}

.auth-card-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.auth-qr-btn:hover {
    color: #38bdf8;
}

.auth-pin-btn.pinned {
    color: #38bdf8 !important;
}

.auth-pin-btn.pinned svg {
    fill: #38bdf8 !important;
    transform: rotate(-45deg);
}

.auth-pin-btn:hover {
    color: #38bdf8;
}

.auth-more-btn:hover {
    color: #38bdf8;
}

.auth-entry-card:has(.auth-context-menu.show),
.auth-entry-card.has-menu-open {
    z-index: 50;
}

.auth-more-btn-wrap {
    position: relative;
    display: inline-block;
}

.auth-context-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.2);
    min-width: 170px;
    padding: 6px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.auth-context-menu.show {
    display: flex;
}

.auth-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-context-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.auth-context-item.danger {
    color: #ef4444;
}

.auth-context-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.auth-context-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}

.auth-code-large {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 21px !important;
    font-weight: 700 !important;
    color: #c084fc !important;
    letter-spacing: 2px !important;
    margin-top: 2px !important;
    text-align: left !important;
    transition: color 0.15s ease;
}

.auth-code-large.code-copied {
    color: #22c55e !important;
}

.auth-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-account-name {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

/* Pie countdown timer (1:1 with Authenticator Chrome Web Store) */
.auth-pie-wrap {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-pie-svg {
    width: 18px;
    height: 18px;
}

.auth-pie-circle {
    fill: none;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-width: 8px;
    stroke-dasharray: 25.1327;
    stroke: #94a3b8;
    transition: stroke-dashoffset 0.8s linear, stroke 0.3s ease;
}

/* QR Code Scanner Animation & Dropzone */
@keyframes authLaserScan {
    0% { top: 12%; opacity: 0.7; }
    50% { top: 86%; opacity: 1; }
    100% { top: 12%; opacity: 0.7; }
}

#authScanDropzone:hover,
#authScanDropzone.dragover {
    border-color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.08) !important;
}

/* QR Code Crop & Selection Box (Authenticator Chrome Store 1:1) */
.auth-crop-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    max-height: 280px;
    background: #020617;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
    user-select: none;
    touch-action: none;
}

.auth-crop-selection {
    position: absolute;
    border: 2px dashed #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    display: none;
    pointer-events: none;
    border-radius: 4px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    z-index: 10;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-crop-selection.success {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.25) !important;
}

.auth-crop-selection.failed {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.2) !important;
}

@keyframes justshopSpin {
    to { transform: rotate(360deg); }
}

.justshop-gw-pill {
    transition: transform 0.15s ease, filter 0.15s ease;
}

.justshop-gw-pill:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}
