/**
 * FlashID Frontend — Button + Modal Styles.
 */

/* ---- Modal Cancel Button (matches superportal section: full-width pill, neutral) ---- */

.flashid-modal-cancel,
.flashid-modal-cancel:link,
.flashid-modal-cancel:visited {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.flashid-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ---- Login Button (legacy) ---- */

.flashid-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0a0e27;
    color: #ffffff;
    border: 2px solid #4f8cff;
    border-radius: 12px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
    line-height: 1;
}

.flashid-btn:hover {
    background: #4f8cff;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 140, 255, 0.4);
}

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

.flashid-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.flashid-btn-small .flashid-btn-icon svg {
    width: 16px;
    height: 16px;
}

.flashid-btn-medium {
    padding: 12px 24px;
    font-size: 15px;
}

.flashid-btn-large {
    padding: 16px 32px;
    font-size: 17px;
}

.flashid-btn-icon {
    display: flex;
    align-items: center;
}

/* ---- Branded Login Button ---- */

.flashid-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: visible;
    transition: transform 0.2s, box-shadow 0.3s;
    box-shadow:
        -20px 0 40px rgba(0, 229, 255, 0.3),
        20px 0 40px rgba(224, 64, 251, 0.3),
        0 0 20px rgba(0, 229, 255, 0.1),
        0 0 20px rgba(224, 64, 251, 0.1);
    line-height: 1;
}

.flashid-login-btn:hover {
    transform: scale(1.03);
    color: #ffffff;
    box-shadow:
        -25px 0 50px rgba(0, 229, 255, 0.4),
        25px 0 50px rgba(224, 64, 251, 0.4),
        0 0 30px rgba(0, 229, 255, 0.15),
        0 0 30px rgba(224, 64, 251, 0.15);
}

.flashid-login-btn:active {
    transform: scale(0.98);
}

.flashid-login-btn:focus {
    outline: 2px solid rgba(0, 229, 255, 0.5);
    outline-offset: 3px;
}

.flashid-login-btn img,
.flashid-login-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.flashid-login-btn span {
    letter-spacing: 0.5px;
}

/* ---- Download Badges ---- */

.flashid-login-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Secure / Encrypted trust pills */
.flashid-trust-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.flashid-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid;
    line-height: 1;
}

.flashid-trust-pill svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.flashid-trust-pill-secure {
    color: #059669;
    background: #ecfdf5;
    border-color: #d1fae5;
}

.flashid-trust-pill-encrypted {
    color: #2563eb;
    background: #eff6ff;
    border-color: #dbeafe;
}

/* Divider above download badges */
.flashid-download-divider-text {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    margin-top: 32px;
}

.flashid-download-divider-text::before,
.flashid-download-divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.35);
}

.flashid-download-divider-text span {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.flashid-download-badges {
    background: transparent;
    padding: 0;
    width: 100%;
    max-width: 340px;
}

/* Official store badge images (Google Play color + App Store white) */
.flashid-store-img-badges {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    width: 100%;
}

.flashid-store-img-link,
.flashid-store-img-link:link,
.flashid-store-img-link:visited,
.flashid-store-img-link:hover,
.flashid-store-img-link:active {
    display: inline-block !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: opacity 0.2s;
}

.flashid-store-img-link:hover {
    opacity: 0.8;
}

.flashid-store-img {
    display: block !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    /* Identical box for both badges; object-fit: contain keeps each
       badge's native aspect ratio intact inside the shared box. */
    width: 160px !important;
    height: 50px !important;
    object-fit: contain !important;
    object-position: center !important;
}

.flashid-store-img-google,
.flashid-store-img-apple {
    width: 160px !important;
    height: 50px !important;
}

.flashid-download-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.flashid-download-divider::before,
.flashid-download-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.3);
}

.flashid-download-divider span {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.flashid-download-links {
    display: flex;
    gap: 10px;
}

.flashid-store-badge,
.flashid-store-badge:link,
.flashid-store-badge:visited,
.flashid-store-badge:hover,
.flashid-store-badge:active {
    flex: 1;
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #000000;
    border: none;
    border-radius: 12px;
    text-decoration: none !important;
    box-shadow: none !important;
    transition: background 0.2s;
}

.flashid-store-badge:hover {
    background: #1a1a1a;
}

.flashid-store-badge * {
    text-decoration: none !important;
    border: none !important;
}

.flashid-store-badge .flashid-store-sub {
    font-size: 9px;
    color: #d1d5db !important;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flashid-store-badge .flashid-store-name {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.2;
}

/* ---- Modal ---- */

.flashid-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashid-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.flashid-modal-content {
    position: relative;
    background: #141836;
    border-radius: 20px;
    padding: 40px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(79, 140, 255, 0.2);
    animation: flashid-modal-in 0.25s ease-out;
}

@keyframes flashid-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.flashid-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #8892b0;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

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

/* Modal Logo */
.flashid-modal-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    background: transparent;
}

/* Modal Header */
.flashid-modal-header h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 6px;
}

.flashid-modal-header h2 span {
    color: #4f8cff;
}

.flashid-modal-header p {
    color: #8892b0;
    font-size: 14px;
    margin: 0 0 24px;
}

/* QR Area */
.flashid-modal-qr {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 16px;
}

.flashid-modal-qr img {
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
}

/* Status pill — background fill shrinks as the countdown elapses.
   Colors match the plugin's dark navy card theme (#141836 + #4f8cff accent). */
.flashid-status-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 100%;
    max-width: 280px;
    margin: 8px auto;
    background: rgba(79, 140, 255, 0.10);
    border: 1px solid rgba(79, 140, 255, 0.18);
    border-radius: 9999px;
    overflow: hidden;
}

.flashid-status-pill-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(79, 140, 255, 0.28);
    border-radius: 9999px;
    transition: width 300ms linear;
    pointer-events: none;
}

/* Status */
.flashid-status {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 500;
    padding: 0 16px;
    color: #ffffff;
    transition: color 0.3s ease;
    text-align: center;
}

.flashid-status-loading { color: #ffffff; }
.flashid-status-waiting { color: #ffffff; }
.flashid-status-success { color: #4ade80; }
.flashid-status-denied  { color: #f87171; }
.flashid-status-expired { color: #fbbf24; }
.flashid-status-error   { color: #f87171; }

/* Timer wrap — clock icon + countdown + progress bar */
.flashid-timer-wrap {
    margin-top: 8px;
}

/* Session ID debug info */
.flashid-session-info {
    margin-top: 14px;
    padding: 8px 12px;
    background: rgba(79, 140, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(79, 140, 255, 0.2);
}

.flashid-session-info label {
    color: #8892b0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.flashid-session-info code {
    color: #4f8cff;
    font-size: 11px;
    word-break: break-all;
    user-select: all;
}

/* Retry */
.flashid-retry {
    padding: 40px 0;
}

.flashid-retry p {
    color: #8892b0;
    margin-bottom: 16px;
}

.flashid-retry-btn {
    background: #4f8cff;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.flashid-retry-btn:hover {
    background: #3b73e0;
}

/* Loading spinner */
@keyframes flashid-spin {
    to { transform: rotate(360deg); }
}

.fid-spin {
    animation: flashid-spin 1.5s linear infinite;
}

.flashid-status-loading::before,
.flashid-status-waiting::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: flashid-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ================================================================
   FID QR-Code Elementor Widget
   ================================================================ */

.fid-qr-widget-wrap {
    display: flex;
    justify-content: center;
}

.fid-qr-widget-card {
    background: #141836;
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(79, 140, 255, 0.12);
}

.fid-qr-widget-logo {
    margin-bottom: 16px;
}

.fid-qr-widget-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.fid-qr-widget-heading {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.fid-qr-widget-subtitle {
    color: #8892b0;
    font-size: 14px;
    margin-bottom: 24px;
}

.fid-qr-widget-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.fid-qr-widget-qr img {
    border-radius: 12px;
    background: #ffffff;
    padding: 10px;
}

.fid-qr-widget-status {
    font-size: 15px;
    font-weight: 500;
}

.fid-qr-widget-timer {
    color: #8892b0;
    font-size: 13px;
    margin-bottom: 4px;
}

/* Editor placeholder */
.fid-qr-editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8892b0;
    font-size: 13px;
}

.fid-qr-editor-placeholder p {
    margin: 10px 0 0;
    text-align: center;
    line-height: 1.4;
}

/* ---- Standalone Mode Session ID Panel ---- */

/* Session ID panel — hidden from users */
.fid-qr-widget-session {
    display: none !important;
}

.fid-qr-session-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.fid-qr-session-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.fid-qr-session-label {
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.fid-qr-session-id {
    color: #fbbf24;
    font-size: 11px;
    font-family: "SF Mono", Menlo, monospace;
    word-break: break-all;
    user-select: all;
    background: rgba(245, 158, 11, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.fid-qr-session-hint {
    color: #94a3b8;
    font-size: 11px;
    margin: 0;
    line-height: 1.4;
}

/* ---- Challenge Display ---- */

.flashid-challenge-area {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.fid-challenge-section {
    width: 260px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.fid-challenge-label {
    color: #8892b0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
}

.fid-challenge-code {
    font-size: 32px;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: 8px;
    font-family: "SF Mono", Menlo, monospace;
}

.fid-challenge-phrase {
    font-size: 18px;
    font-weight: 500;
    color: #c8d0e0;
    font-style: italic;
    line-height: 1.4;
}

.fid-challenge-shape {
    font-size: 16px;
    font-weight: 600;
    color: #4f8cff;
    text-transform: capitalize;
}

.fid-challenge-target {
    font-weight: 500;
    color: #ffffff;
    padding: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: inline-block;
}

.fid-challenge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 260px;
    margin: 0 auto;
}

.fid-challenge-grid-2col {
    grid-template-columns: repeat(3, 1fr);
}

.fid-challenge-cell {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    color: #ffffff;
    font-weight: 500;
    transition: background 0.2s;
}

.fid-play-sound-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4f8cff;
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin: 8px 0;
}

.fid-play-sound-btn:hover {
    background: #3b73e0;
    transform: scale(1.02);
}

.fid-play-sound-btn:active {
    transform: scale(0.98);
}

.fid-play-icon {
    font-size: 18px;
}

.fid-challenge-color-cell {
    min-height: 48px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 480px) {
    .flashid-modal-content {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .flashid-modal-qr img {
        width: 220px;
        height: 220px;
    }

    .fid-qr-widget-card {
        padding: 24px 20px;
        border-radius: 16px;
    }
}
