/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    /* Dark Theme (Default) */
    --bg-color: #0d0d0d;
    --card-bg: #161616;
    --header-bg: rgba(13, 13, 13, 0.95);
    --element-bg: #1a1a1a;
    --hover-bg: #2a2a2a;

    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;

    --border-color: #333;

    /* Accents */
    --accent-color: #3b82f6;
    --shine-pink: #d946ef;
    --shine-blue: #60a5fa;
    --price-green: #a3e635;
    --price-blue: #3b82f6;
    --price-purple: #c084fc;
}

[data-theme="light"] {
    /* Light Theme Overrides */
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.95);
    --element-bg: #e5e7eb;
    --hover-bg: #d1d5db;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --border-color: #d1d5db;
}

body,
html {
    overflow-x: hidden;
    /* Force prevent horizontal scroll */
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

#logo {
    width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.logo .shine {
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo .shop {
    background: linear-gradient(to right, var(--shine-pink), var(--shine-blue));
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 1.2rem;
}

/* Search Box */
.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--element-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 10px;
    width: 250px;
    transition: all 0.2s;
}

.search-wrapper:focus-within {
    border-color: var(--shine-blue);
    width: 300px;
}

#search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 0;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

.nav-middle .balance-badge {
    background: var(--element-bg);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--shine-blue);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-text {
    background: var(--element-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-block;
}

.btn-text:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
}

.icon-btn:hover {
    color: var(--text-primary);
}

/* Marquee */
.marquee-container {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Main Content */
.main-content {
    padding-top: 30px;
    padding-bottom: 50px;
}

.alert-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.9rem;
    padding: 10px 15px;
    background: var(--element-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
}

.alert-bar.hidden {
    display: none;
}

.alert-bar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.alert-bar-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@keyframes rainbow-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.card {
    background-color: transparent;
    /* Handled by ::after */
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 0;
    padding: 5px;
    /* Solution: Create gap for border to show */
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

/* Static Border / Dynamic Rainbow Layer */
.card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 101%;
    height: 101%;
    /* Slightly larger to fill gap */
    background: var(--border-color);
    transform: translate(-50%, -50%);
    z-index: -2;
    transition: width 0.3s, height 0.3s;
}

/* Inner Background Layer */
.card::after {
    content: '';
    position: absolute;
    inset: 3px;
    /* Match padding so bg sits behind content */
    background: var(--card-bg);
    border-radius: 9px;
    /* 12px - 3px */
    z-index: -1;
    /* transition: inset 0.3s; Remove transition for solid feel */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    width: 250%;
    /* Grow larger for rotation */
    height: 250%;
    background: conic-gradient(#ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff, #ff0000);
    animation: rainbow-spin 2s linear infinite;
}

.card:hover::after {
    inset: 3px;
    /* Keep consistent */
}

/* Water Ripple Effect (when NOT hovering) */
.card:not(:hover) {
    animation: ripple-pulse 2s ease-in-out infinite;
}

@keyframes ripple-pulse {

    0%,
    100% {
        box-shadow:
            0 0 0 0 rgba(100, 200, 255, 0.4),
            0 0 0 0 rgba(100, 200, 255, 0.2);
    }

    50% {
        box-shadow:
            0 0 0 10px rgba(100, 200, 255, 0),
            0 0 0 20px rgba(100, 200, 255, 0);
    }
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
    padding: 0;
    border-radius: 7px 7px 0 0;
}

.card-img-wrapper {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    /* Keep image bg dark usually logic */
    /* padding: 20px; Removed to fit container better */
    border-radius: 7px 7px 0 0;
    overflow: hidden;
    /* Smooth corners matching inner border */
}

.card-body {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 5px;
}

.price-prefix {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-price {
    font-size: 1rem;
    font-weight: 700;
    /* Rainbow gradient from left to right */
    background: linear-gradient(90deg,
            #ff0000,
            /* Red */
            #ff8000,
            /* Orange */
            #ffff00,
            /* Yellow */
            #00ff00,
            /* Green */
            #00bfff,
            /* Cyan */
            #0080ff,
            /* Blue */
            #8000ff
            /* Violet */
        );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 3s linear infinite;
}

@keyframes rainbow-flow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

/* Remove old color classes - now using rainbow */
.price-blue,
.price-purple,
.price-green {
    /* Override with same rainbow style */
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00bfff, #0080ff, #8000ff);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-flow 3s linear infinite;
}

/* Inactive Section */
.section-divider {
    margin: 60px 0 20px;
    display: flex;
    justify-content: center;
}

.status-badge {
    background: var(--element-bg);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-grid.inactive .card {
    opacity: 0.6;
}

.product-grid.inactive .card:hover {
    transform: none;
    cursor: not-allowed;
    opacity: 0.8;
}

.tag-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #444;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
    pointer-events: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Chat Widget Container */
.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.chat-widget {
    width: 60px;
    height: 60px;
    background: var(--shine-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-widget:hover {
    transform: scale(1.1);
}

/* Social Bubbles */
.social-bubbles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease-out;
}

.social-bubbles.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.bubble {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    transition: transform 0.2s;
    text-decoration: none;
    overflow: hidden;
}

.bubble:hover {
    transform: translateX(-5px) scale(1.1);
}

.bubble.zalo {
    background: #0180c7;
    border: 2px solid white;
}

.bubble.fb {
    background: #1877f2;
    color: white;
    border: 2px solid white;
}

.bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Social Buttons */
.btn-social {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    font-size: 0.95rem;
    transition: transform 0.2s;
}

.btn-social:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.btn-social.zalo {
    background: #0180c7;
}

.btn-social.fb {
    background: #1877f2;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    width: 900px;
    max-width: 100%;
    /* Max height for scroll */
    max-height: 90vh;
    display: flex;
    flex-direction: column;

    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    padding: 0;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    color: var(--text-primary);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--element-bg);
    border: none;
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow-y: auto;
    /* Enable vertical scroll */
}

.modal-left {
    padding: 30px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image-container {
    width: 100%;
    height: 250px;
    background: #000;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn {
    background: var(--element-bg);
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-note-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.modal-right {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-box {
    background: rgba(59, 130, 246, 0.05);
    /* Blue tint */
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 15px;
    border-radius: 8px;
}

.info-item h4 {
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.check-list {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.check-list li {
    margin-bottom: 5px;
    display: flex;
    gap: 8px;
    align-items: start;
}

.check-list i {
    color: #10b981;
    margin-top: 3px;
}

.check-list .red-text {
    color: #ef4444;
}

.check-list .red-text i {
    color: #ef4444;
}

/* Quantity */
.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.qty-controls {
    display: flex;
    align-items: center;
    background: var(--element-bg);
    border-radius: 8px;
    padding: 5px;
}

.qty-controls button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.qty-val {
    width: 40px;
    text-align: center;
    font-weight: 600;
}

.discount-hint {
    color: #eab308;
    /* Yellow */
    font-size: 0.8rem;
}

/* Pricing Options */
.pricing-options {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    /* Align left to look better when wrapped */
    flex-wrap: wrap;
    /* Allow wrapping */
}

.price-option {
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 12px;
    flex: 1;
    min-width: 120px;
    /* Ensure they don't get too small */
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    /* For absolute badge */
}

.price-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: #444;
}

.sold-out-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.price-option.selected {
    border-color: var(--shine-blue);
    background: rgba(59, 130, 246, 0.1);
}

.badg-time {
    background: var(--element-bg);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.price-val {
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--shine-blue);
}

/* Modal Footer */
.modal-footer-actions {
    margin-top: auto;
    text-align: center;
}

.support_note {
    font-size: 0.8rem;
    color: #eab308;
    background: rgba(234, 179, 8, 0.1);
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: inline-block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn-group button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-primary {
    background: #333;
    /* Default dark */
    border: none;
    color: white;
}

.btn-primary:hover {
    background: #444;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-left {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .modal-content {
        margin: 10px;
        height: auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .header-container {
        padding: 0 10px;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        /* Center content */
    }

    /* 1. Break .nav-right so we can reorder Button and Toggle separately */
    .nav-right {
        display: contents;
        /* MAGIC: Children become direct flex items of .header-container */
    }

    /* ROW 1: Logo */
    .logo {
        font-size: 1.2rem;
        order: 1;
        width: 100%;
        text-align: center;
        justify-content: center;
        margin-bottom: 5px;
    }

    /* ROW 2: Terms "btn-text" (was inside nav-right) */
    .btn-text {
        font-size: 0.8rem;
        padding: 8px;
        display: flex !important;
        /* Make it flex to center */
        width: 100%;
        order: 2;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        /* Slight bg to distinguishing row */
        border-radius: 6px;
        margin-bottom: 5px;
    }

    /* ROW 3: Search + Toggle */
    .search-wrapper {
        order: 3;
        flex: 1;
        /* Take remaining space */
        min-width: 0;
        /* Allow shrinking */
    }

    #theme-toggle {
        order: 4;
        margin-left: 10px;
        width: 40px;
        /* Fixed width for toggle */
        height: 40px;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-middle {
        display: none;
    }

    .modal-image-container img {
        object-fit: contain;
    }
}

.total-price-area {
    margin: 20px 0 10px;
    padding: 15px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed var(--shine-blue);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.final-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--price-green);
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    animation: fadeIn 0.3s;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.no-results p {
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Support Modal Specifics */
.support-body {
    display: flex !important;
    /* Override grid */
    flex-direction: column;
    padding: 20px 40px !important;
    gap: 15px;
    text-align: left;
}

.support-intro {
    font-size: 1rem;
    font-weight: 500;
}

.support-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 10px;
}

.support-list {
    list-style: disc;
    padding-left: 25px;
}

.support-list li {
    display: list-item;
    margin-bottom: 8px;
}

.support-list li .icon {
    margin-right: 5px;
}

.support-time,
.support-note {
    font-size: 0.95rem;
    line-height: 1.5;
}

.support-footer {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.custom-close-btn {
    background-color: #60a5fa;
    /* Light blue like in image */
    color: white;
    padding: 10px 30px;
    border-radius: 5px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.custom-close-btn:hover {
    background-color: #3b82f6;
}

/* Product Description List */
.product-desc-list {
    margin-top: 5px;
}

.desc-item {
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.5;
    padding-left: 24px;
    /* Space for icon */
    text-indent: -24px;
    /* Pull first line (icon) back */
}

/* ===================== TOTP 2FA DECODER PAGE ===================== */

.totp-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.totp-header {
    text-align: center;
    margin-bottom: 40px;
}

.totp-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.totp-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.totp-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Input Area */
.totp-input-area {
    margin-bottom: 30px;
}

.totp-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.totp-label i {
    color: var(--shine-blue);
}

.totp-input-row {
    display: flex;
    gap: 8px;
}

.totp-input {
    flex: 1;
    background: var(--element-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', monospace;
    letter-spacing: 2px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.totp-input:focus {
    border-color: var(--shine-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.totp-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
    font-size: 0.9rem;
}

.totp-btn {
    border: none;
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    white-space: nowrap;
}

.totp-btn.decode {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.totp-btn.decode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.totp-btn.clear {
    background: var(--element-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.totp-btn.clear:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Error Message */
.totp-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 10px;
    padding: 0 4px;
    display: none;
}

.totp-error.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/* Result Area */
.totp-result {
    margin-bottom: 35px;
    transition: all 0.4s ease;
}

.totp-result.hidden {
    display: none;
}

.totp-result.show {
    display: block;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Code Card */
.totp-code-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.totp-code-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #d946ef);
}

.totp-code-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.totp-code {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: 12px;
    font-family: 'Inter', monospace;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #d946ef);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    margin-bottom: 20px;
    user-select: all;
}

.totp-code.pulse {
    animation: codePulse 0.5s ease;
}

@keyframes codePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.totp-copy-btn {
    background: var(--element-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.totp-copy-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.totp-copy-btn.copied {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

/* Countdown */
.totp-countdown {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.totp-countdown-track {
    flex: 1;
    height: 6px;
    background: var(--element-bg);
    border-radius: 3px;
    overflow: hidden;
}

.totp-countdown-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
    transition: width 1s linear, background 0.5s;
}

.totp-countdown-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

.totp-auto-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.totp-auto-note i {
    margin-right: 4px;
}

/* Guide */
.totp-guide {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
}

.totp-guide h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.totp-guide h3 i {
    color: var(--shine-blue);
    margin-right: 6px;
}

.totp-guide ol {
    list-style: decimal;
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.totp-guide ol strong {
    color: var(--text-primary);
}

.totp-security-note {
    margin-top: 18px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    color: #22c55e;
    font-size: 0.82rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.totp-security-note i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ---- TOTP Responsive ---- */
@media (max-width: 600px) {
    .totp-header h1 {
        font-size: 1.4rem;
    }

    .totp-input-row {
        flex-direction: column;
    }

    .totp-btn {
        justify-content: center;
    }

    .totp-code {
        font-size: 2.2rem;
        letter-spacing: 8px;
    }

    .totp-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        border-radius: 16px;
    }
}