/* =========================================================
   AMERI DESIGN SYSTEM — COMPONENTS
   Bento Cards, Signature White Buttons, Inputs, Badges, Modals
   ========================================================= */

/* --- BOTONES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 550;
    font-family: var(--font-main);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
    user-select: none;
}

.btn-primary {
    background-color: var(--accent-pink);
    color: #111111;
    border-color: var(--accent-pink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    background-color: var(--accent-pink-hover);
    border-color: var(--accent-pink-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(207, 140, 161, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-discord {
    background-color: #5865F2;
    color: #ffffff;
    border-color: #5865F2;
}

.btn-discord:hover {
    background-color: #4752c4;
    border-color: #4752c4;
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.25);
}

.btn-sm {
    padding: 6px 13px;
    font-size: 12px;
    border-radius: 7px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- TARJETAS BENTO --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
}

.bento-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(255, 255, 255, 0) 100%), #0c0c0e;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.2s ease;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink) 0%, #f7a8c4 50%, var(--accent-pink) 100%);
    box-shadow: 0 0 12px rgba(207, 140, 161, 0.7);
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.09);
    transform: translateY(-2px);
}

.bento-card:hover::before {
    transform: scaleX(1);
    opacity: 1;
}

/* Variante plana, igual al profile-banner: fondo sólido #0a0a0a (línea rosa solo en hover, como las demás cards) */
.bento-card-flat {
    background: #0a0a0a;
    border-top-color: rgba(255, 255, 255, 0.055);
}

.bento-card-flat:hover {
    transform: none;
}

.bento-card-flat::before {
    box-shadow: none;
}

.bento-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bento-card-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-card-title i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

.bento-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Card 1: Stat Hero */
.bento-stat-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 0 16px 0;
}

.bento-stat-num {
    font-size: 44px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.license-key-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(234, 142, 184, 0.12);
    border: 1px solid rgba(234, 142, 184, 0.35);
    color: var(--accent-pink);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bento-stat-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bento-stat-unit {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.bento-stat-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.license-empty-state {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 0 16px 0;
}

.license-stat-box {
    background: #08080a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 18px 20px;
    margin: 10px 0 16px 0;
}

.license-stat-box .bento-stat-hero,
.license-stat-box .license-empty-state {
    margin: 0;
}

.license-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.license-empty-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.license-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.license-empty-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

/* Card Actions Container */
.bento-card-actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Card 2: HWID Capsule — el valor real nunca se renderiza, solo el estado */
.hwid-capsule {
    background-color: #08080a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 0 16px 0;
}

.hwid-status-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    font-size: 18px;
}

.hwid-status-icon--bound {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
    color: #34d399;
}

.hwid-value {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
}

.hwid-cooldown-pill,
.settings-locked-note.settings-cooldown-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-size: 12.5px;
    font-weight: 550;
    font-family: var(--font-main);
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 8px 16px;
}

.hwid-cooldown-pill i {
    font-size: 13px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.3);
}

.hwid-pending-pill {
    color: rgba(255, 255, 255, 0.55);
}

/* Card 3: PIN row — icono, pin, tiempo (mismo patron que License) */
/* Contorno de cuenta regresiva: trazo SVG (longitud real del perímetro), no conic-gradient.
   Conic-gradient reparte el progreso por ANGULO, y en un rectángulo eso hace que las esquinas
   avancen más lento/rápido que los lados rectos (velocidad dispareja). Un stroke-dashoffset
   sobre un <rect> avanza según la LONGITUD real del borde, así que la velocidad es constante
   en todo el recorrido. */
.pin-progress-box {
    position: relative;
}

.pin-progress-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.pin-progress-box.pin-progress-active .pin-progress-ring {
    opacity: 1;
}

.pin-progress-ring-rect {
    x: 1px;
    y: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    rx: 9px;
    ry: 9px;
    fill: none;
    stroke: var(--accent-pink);
    stroke-width: 1.5px;
    stroke-dasharray: 100 100;
    stroke-dashoffset: 0;
}

.pin-progress-box.pin-progress-active .pin-progress-ring-rect {
    animation: pin-countdown-ring linear forwards;
    animation-duration: var(--pin-duration, 60s);
}

@keyframes pin-countdown-ring {
    from {
        stroke-dashoffset: var(--pin-offset-start, 0);
    }

    to {
        stroke-dashoffset: 100;
    }
}

.pin-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pin-digits {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 30px;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.2s ease;
}

.pin-digits.pin-active {
    color: #ffffff;
}

.pin-copy-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    margin-left: -6px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.pin-copy-btn:hover {
    color: var(--accent-pink);
    transform: scale(1.1);
}

#pin-display.pin-active + .pin-copy-btn {
    display: inline-flex;
}

.pin-timer-text {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s ease;
}

.pin-timer-text.pin-timer-active {
    color: var(--accent-pink);
}

/* Card 4: Specs List */
.spec-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-weight: 450;
}

.spec-val-primary {
    color: #ffffff;
    font-weight: 550;
    font-size: 12px;
}

.spec-tag-warn {
    font-size: 11px;
    font-weight: 500;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.18);
    padding: 2px 7px;
    border-radius: 4px;
}

.spec-tag-success {
    font-size: 11px;
    font-weight: 500;
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.18);
    padding: 2px 7px;
    border-radius: 4px;
}

/* --- BADGES / ETIQUETAS --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.badge-emerald {
    background-color: rgba(16, 185, 129, 0.08);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-gray {
    background-color: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-amber {
    background-color: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-red {
    background-color: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-violet {
    background-color: rgba(139, 92, 246, 0.08);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-pink {
    background-color: rgba(234, 142, 184, 0.12);
    color: var(--accent-pink);
    border: 1px solid rgba(234, 142, 184, 0.35);
    font-weight: 700;
    text-transform: uppercase;
}

.profile-role-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-pink);
    font-size: 16px;
    line-height: 1;
    position: relative;
    top: -2px;
    flex-shrink: 0;
}

/* --- GLOBAL TOOLTIP (escapa cualquier overflow:hidden, se posiciona con JS) --- */
.global-tooltip {
    position: fixed;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease;
    z-index: 9999;
}

.global-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.global-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}

/* Cuando el tooltip queda debajo del elemento (p.ej. navbar, sin lugar arriba),
   el pico se invierte para seguir apuntando hacia el elemento. */
.global-tooltip.tooltip-flip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #1a1a1a;
}

#btn-redeem-main,
#btn-generate-2fa {
    transition: filter 0.15s ease, transform 0.15s ease;
}

#btn-redeem-main:hover,
#btn-generate-2fa:hover {
    box-shadow: none;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* --- PROFILE BANNER --- */
.profile-banner {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.profile-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink) 0%, #f7a8c4 50%, var(--accent-pink) 100%);
}

.profile-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(234, 142, 184, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-ring {
    box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px var(--accent-pink);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.discord-corner-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5865F2;
    border: 2.5px solid #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #ffffff;
}

.profile-banner-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-quick-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.profile-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #141414;
    border: 1px solid #222222;
    color: #cfd3dc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 150ms ease;
}

.profile-action-btn:hover {
    background: #1c1c1c;
    color: var(--accent-pink);
}

.profile-banner-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-username {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .profile-banner {
        justify-content: flex-start;
    }
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    display: inline-block;
}

.dot-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* --- CAMPOS DE ENTRADA (INPUTS) --- */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

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

.admin-search-wrapper {
    width: 280px;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
    pointer-events: none;
}

.form-input {
    width: 100%;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input.has-icon {
    padding-left: 44px;
}

.form-input:focus {
    border-color: var(--accent-pink);
    background-color: rgba(244, 114, 182, 0.04);
    box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* --- TABLAS DE DATOS --- */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background-color: var(--bg-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    background-color: #101116;
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 7, 10, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background-color: #121216;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.modal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink) 0%, #f7a8c4 50%, var(--accent-pink) 100%);
    box-shadow: 0 0 12px rgba(207, 140, 161, 0.7);
}

.modal-overlay.active .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover {
    color: #ffffff;
}

/* --- SKELETON LOADER & REVEAL (transitions.dev, patrón 14-skeleton-reveal) ---
   Adaptado para contenido de alto variable: a diferencia del snippet original
   (donde .t-skel-skeleton Y .t-skel-content van ambos position:absolute, lo que
   exige que el padre tenga una altura fija), acá .t-skel-content queda en flujo
   normal (define la altura real de la card) y SOLO .t-skel-skeleton es absolute,
   superpuesto exactamente sobre esa caja. Mismas clases/estados que el patrón
   original (.t-skel, .t-skel-skeleton, .t-skel-content, .is-pulsing,
   .is-revealed, .is-resetting), misma lógica de cross-fade + cross-blur. */
:root {
    --pulse-dur: 1000ms;
    --pulse-count: 1;
    --pulse-min: 0.5;
    --reveal-dur: 400ms;
    --reveal-blur: 2px;
    --reveal-ease: ease-in-out;
}

.t-skel {
    position: relative;
}

.t-skel-skeleton {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 1;
    filter: blur(0);
    transition:
        opacity var(--reveal-dur) var(--reveal-ease),
        filter var(--reveal-dur) var(--reveal-ease);
}

.t-skel-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    filter: blur(var(--reveal-blur));
    transition:
        opacity var(--reveal-dur) var(--reveal-ease),
        filter var(--reveal-dur) var(--reveal-ease);
}

.t-skel.is-revealed .t-skel-skeleton {
    opacity: 0;
    filter: blur(var(--reveal-blur));
    pointer-events: none;
}

.t-skel.is-revealed .t-skel-content {
    opacity: 1;
    filter: blur(0);
}

/* Snap-back instantáneo al re-mostrar el skeleton (p.ej. recarga de datos) */
.t-skel.is-resetting .t-skel-skeleton,
.t-skel.is-resetting .t-skel-content {
    transition: none !important;
}

.t-skel-skeleton.is-pulsing > * {
    animation: t-skel-pulse var(--pulse-dur) ease-in-out var(--pulse-count);
}

@keyframes t-skel-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: var(--pulse-min); }
}

/* Barra placeholder reutilizable para armar cualquier forma de skeleton */
.t-skel-bar {
    display: block;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
}

/* Variante para filas de tabla regeneradas por fetch (ver skeletonTableRows()
   en api.js): pulsa en loop continuo, ya que no hay un estado .is-pulsing
   puntual que la dispare una sola vez — se la saca del DOM al llegar los datos. */
.t-skel-bar--row {
    animation: t-skel-pulse var(--pulse-dur) ease-in-out infinite;
}

/* Envoltorio "fantasma": aplicado sobre las mismas clases reales (.badge,
   .btn...) que el contenido final usará, para que el bloque del esqueleto
   herede exactamente su padding/border/radius/line-height (mismo alto que el
   componente real) sin heredar su color — así no hay salto de tamaño al
   reemplazar el esqueleto por el contenido real. */
.t-skel-ghost {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: transparent !important;
    pointer-events: none;
}

/* Fade + cross-blur de entrada para filas reales recién insertadas (ver
   fadeInRows() en api.js), ya que no existe una capa .t-skel-content previa
   con la que hacer cross-fade: las filas se arman desde cero por fetch. */
@keyframes t-skel-rows-in {
    from { opacity: 0; filter: blur(var(--reveal-blur)); }
    to { opacity: 1; filter: blur(0); }
}
.t-skel-rows-in {
    animation: t-skel-rows-in var(--reveal-dur) var(--reveal-ease);
}

@media (prefers-reduced-motion: reduce) {
    .t-skel-skeleton, .t-skel-content {
        transition: none !important;
    }
    .t-skel-skeleton.is-pulsing > * { animation: none !important; }
    .t-skel-bar--row { animation: none !important; }
    .t-skel-rows-in { animation: none !important; }
}

/* --- TOAST NOTIFICATIONS (estilo Sonner, ver ui.shadcn.com/docs/components/radix/sonner) --- */
#toast-container {
    --toast-width: 356px;
    --toast-gap: 12px;
    --toast-lift: 14px;
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: var(--toast-width);
    max-width: calc(100vw - 32px);
    list-style: none;
}

.toast {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background-color: #0c0c0c;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    cursor: grab;
    touch-action: none;
    will-change: transform, opacity;
    transform: translateY(calc(var(--toast-y, 0) * 1px)) scale(var(--toast-scale, 1));
    opacity: var(--toast-opacity, 1);
    z-index: var(--toast-z, 1);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease;
}

.toast:active {
    cursor: grabbing;
}

.toast.toast-dragging {
    transition: none;
}

#toast-container.expanded .toast {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 1px;
    font-size: 15px;
}

.toast-success .toast-icon,
.toast-error .toast-icon,
.toast-info .toast-icon {
    color: var(--accent-pink);
}

.toast-message {
    flex: 1;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: -2px -4px 0 0;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.toast:hover .toast-close {
    opacity: 1;
}

.toast-close:hover {
    background-color: var(--border-hover);
    color: var(--text-primary);
}

.toast.toast-entering {
    animation: toastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(calc(var(--toast-y, 0) * 1px - 16px)) scale(0.96);
    }
}

.toast.toast-out {
    transition: transform 0.25s ease, opacity 0.25s ease;
    opacity: 0;
    transform: translateY(calc(var(--toast-y, 0) * 1px - 6px)) scale(0.96);
}

.toast.toast-swiped-out {
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

/* --- LANGUAGE SELECTOR WIDGET --- */
.lang-icon-btn {
    height: 38px;
    width: 38px;
    padding: 0;
    border-radius: calc(0.85rem - 0.35rem);
    background: #141414;
    border: 1px solid #222222;
    color: #cfd3dc;
    font-size: 13.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 150ms ease;
}

.lang-icon-btn:hover {
    background: #1c1c1c;
    border-color: #333333;
    color: #ffffff;
}

.lang-icon-btn i {
    position: relative;
    top: 1px;
}

/* --- SETTINGS PAGE --- */
/* --- Hero de perfil: sin card, flotando sobre el fondo --- */
/* --- Panel único de Settings: una sola card ancha, filas con divisores --- */
.settings-panel {
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 14px;
}

.settings-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink) 0%, #f7a8c4 50%, var(--accent-pink) 100%);
}

.settings-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0 28px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    padding: 26px 28px;
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.settings-row-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.settings-row-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-profile-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.settings-row-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    white-space: nowrap;
}

.settings-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.settings-row-control {
    flex-shrink: 0;
}

.settings-hero-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.settings-hero-avatar {
    width: 76px;
    height: 76px;
    font-size: 26px;
}

.settings-profile-discord-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.settings-avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-pink);
    color: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 3px solid #0a0a0a;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.settings-avatar-edit-btn:hover {
    background: var(--accent-pink-hover);
    transform: scale(1.08);
}

.settings-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.settings-profile-badge i {
    position: relative;
    font-size: 10px;
}

.settings-profile-badge--discord,
.settings-profile-badge--cooldown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.settings-avatar-confirm-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.settings-remove-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.settings-remove-link:hover {
    color: #f87171;
}

.settings-lang-switch {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: #18181a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.settings-lang-option {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.settings-lang-option:hover {
    color: #ffffff;
}

.settings-lang-option.active {
    background: var(--accent-pink);
    color: #111111;
}

.settings-theme-switch {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: #18181a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.settings-theme-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.settings-theme-option:hover {
    color: #ffffff;
}

.settings-theme-option.active {
    background: var(--accent-pink);
    color: #111111;
}

.settings-input-row {
    display: flex;
    gap: 10px;
}

.settings-input-row .input-wrapper {
    width: 260px;
}

.settings-locked-note {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 10px 14px;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-row-desc,
    .settings-locked-note {
        white-space: normal;
    }

    .settings-divider {
        margin: 0 20px;
    }

    .settings-lang-switch,
    .settings-theme-switch,
    .settings-input-row {
        width: 100%;
    }

    .settings-lang-option,
    .settings-theme-option {
        flex: 1;
        justify-content: center;
    }

    .settings-input-row {
        flex-wrap: wrap;
    }

    .settings-input-row .input-wrapper {
        width: 100%;
    }
}

/* --- DOWNLOADS PAGE --- */
.download-wrapper {
    min-height: calc(100vh - 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 120px;
}

.download-stack-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 440px;
}

.download-note-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(244, 114, 182, 0.05) 0%, rgba(244, 114, 182, 0) 220px), #0d0a0c;
    border: 1px solid rgba(244, 114, 182, 0.14);
    border-radius: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
}

.download-note-card i {
    color: var(--accent-pink);
    flex-shrink: 0;
}

.download-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, rgba(244, 114, 182, 0.05) 0%, rgba(244, 114, 182, 0) 220px), #0d0a0c;
    border: 1px solid rgba(244, 114, 182, 0.14);
    border-radius: 14px;
    padding: 44px 38px;
    text-align: center;
    transition: border-color 0.15s ease, transform 0.2s ease;
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink) 0%, #f7a8c4 50%, var(--accent-pink) 100%);
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.download-card:hover {
    border-color: rgba(244, 114, 182, 0.22);
    transform: translateY(-2px);
}

.download-card:hover::before {
    transform: scaleX(1);
    opacity: 1;
}

.download-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.download-icon img {
    width: 88px;
    height: 88px;
    object-fit: contain;
}

.download-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.download-subtitle {
    font-size: 13px;
    color: #a99aa0;
    line-height: 1.6;
    margin: 0 auto 26px;
    max-width: 360px;
}

.download-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-subtle);
}

.download-hint a {
    color: var(--accent-pink);
    text-decoration: none;
    font-weight: 600;
}

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

.download-btn {
    width: 100%;
    padding: 14px;
    font-size: 14.5px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .download-card {
        padding: 30px 22px;
    }
}