/* =====================================================
   FacialProof – Shared Design System
   Applied across all four feature tabs
   ===================================================== */

/* ---- Base + design tokens (light, premium; existing blues/greens) ---- */
.feature-html-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #111827;
    --fp-radius-xl: 20px;
    --fp-radius-lg: 14px;
    --fp-radius-md: 12px;
    --fp-radius-sm: 10px;
    --fp-border: 1px solid #e8ecf1;
    --fp-surface-page: #f4f6f9;
    --fp-shadow-shell: 0 4px 28px rgba(15, 23, 42, 0.07);
    --fp-shadow-card: 0 2px 14px rgba(15, 23, 42, 0.06);
}

.feature-html-wrapper * {
    box-sizing: border-box;
}

/* ---- Container card ---- */
.feature-html-wrapper .container {
    max-width: 100% !important;
    width: 100% !important;
    background: #ffffff;
    border: var(--fp-border);
    border-radius: var(--fp-radius-xl);
    box-shadow: var(--fp-shadow-shell);
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* ---- Header ---- */
.feature-html-wrapper .header {
    background: #ffffff;
    color: #111827;
    padding: 18px 22px 16px;
    text-align: center;
    border-bottom: var(--fp-border);
    position: relative;
}

.feature-html-wrapper .header h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
    color: #111827;
}

.feature-html-wrapper .header p,
.feature-html-wrapper .header .subtitle {
    font-size: 0.88rem;
    color: #6b7280;
    margin: 0;
}

/* ---- Shared content area ---- */
.feature-html-wrapper .content {
    padding: 16px 18px;
    background: var(--fp-surface-page);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

/* ---- Shared status bar ---- */
.feature-html-wrapper .status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fffbeb;
    color: #92400e;
    margin: 10px 16px 12px;
    border-radius: var(--fp-radius-md);
    border: 1px solid #fde68a;
    font-weight: 500;
    font-size: 0.84rem;
    text-align: center;
    box-sizing: border-box;
}

.feature-html-wrapper .status.success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #6ee7b7;
}

.feature-html-wrapper .status.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}

.feature-html-wrapper .status.info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ---- Controls toolbar ---- */
.feature-html-wrapper .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: var(--fp-border);
    box-sizing: border-box;
}

/* ---- Buttons – base ---- */
.feature-html-wrapper button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1.5px solid transparent;
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    line-height: 1.4;
    text-align: center;
}

/* Primary */
.feature-html-wrapper .btn-primary,
.feature-html-wrapper button.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.feature-html-wrapper .btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.feature-html-wrapper .btn-primary:active:not(:disabled) {
    background: #1e40af;
    border-color: #1e40af;
    transform: translateY(0);
    box-shadow: none;
}

.feature-html-wrapper .btn-primary:disabled {
    background: #93c5fd;
    border-color: #93c5fd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* Secondary */
.feature-html-wrapper .btn-secondary,
.feature-html-wrapper button.btn-secondary {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.feature-html-wrapper .btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #2563eb;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.feature-html-wrapper .btn-secondary:active:not(:disabled) {
    background: #f3f4f6;
    transform: translateY(0);
    box-shadow: none;
}

.feature-html-wrapper .btn-secondary:disabled {
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* Success */
.feature-html-wrapper .btn-success,
.feature-html-wrapper button.btn-success {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.feature-html-wrapper .btn-success:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

.feature-html-wrapper .btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---- Generic card ---- */
.feature-html-wrapper .card,
.feature-html-wrapper .result-card,
.feature-html-wrapper .reference-panel,
.feature-html-wrapper .results-panel {
    background: #ffffff;
    border: var(--fp-border);
    border-radius: var(--fp-radius-lg);
    box-shadow: var(--fp-shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.feature-html-wrapper .result-card {
    padding: 14px 16px;
    border-left: 3px solid #2563eb;
}

.feature-html-wrapper .result-card:hover,
.feature-html-wrapper .card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    transform: translateY(-1px);
}

.feature-html-wrapper .result-card h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.feature-html-wrapper .result-card .value {
    font-size: 1.2rem;
    color: #2563eb;
    font-weight: 700;
    margin-top: 4px;
}

.feature-html-wrapper .result-card .description {
    color: #6b7280;
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ---- Measurement list (inside cards) ---- */
.feature-html-wrapper .measurements {
    background: transparent;
    padding: 0;
    border: none;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.feature-html-wrapper .measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f0f2f5;
    gap: 8px;
}

.feature-html-wrapper .measurement-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.feature-html-wrapper .measurement-label {
    color: #9ca3af;
    font-weight: 500;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.feature-html-wrapper .measurement-value {
    color: #111827;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: right;
    word-break: break-word;
}

/* ---- Section title (used in liveness page) ---- */
.feature-html-wrapper .section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    padding-bottom: 8px;
    border-bottom: var(--fp-border);
    margin: 0 0 10px 0;
}

/* ---- Video / media containers ---- */
.feature-html-wrapper .video-container,
.feature-html-wrapper .id-container {
    position: relative;
    background: #eef1f6;
    border-radius: var(--fp-radius-lg);
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    max-height: 420px;
    border: 2px dashed #d1d5db;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.feature-html-wrapper .video-container.active,
.feature-html-wrapper .id-container.has-image {
    border-style: solid;
    border-color: #2563eb;
}

.feature-html-wrapper .placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}

/* ---- Loader spinner ---- */
.feature-html-wrapper .loader {
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: fp-spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes fp-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .feature-html-wrapper .container {
        border-radius: var(--fp-radius-lg);
    }

    .feature-html-wrapper .header {
        padding: 16px 18px 14px;
    }

    .feature-html-wrapper .header h1 {
        font-size: 1.2rem !important;
    }

    .feature-html-wrapper .header p {
        font-size: 0.82rem !important;
    }

    .feature-html-wrapper .controls {
        padding: 12px 16px;
    }

    .feature-html-wrapper .status {
        margin: 8px 14px 10px;
        font-size: 0.82rem;
    }

    .feature-html-wrapper .video-container,
    .feature-html-wrapper .id-container {
        min-height: 220px;
        max-height: 320px;
        border-radius: var(--fp-radius-md);
    }
}

@media (max-width: 480px) {
    .feature-html-wrapper .header {
        padding: 14px 16px;
    }

    .feature-html-wrapper .header h1 {
        font-size: 1rem !important;
    }

    .feature-html-wrapper .controls {
        padding: 10px 12px;
    }

    .feature-html-wrapper button {
        width: 100% !important;
        padding: 10px 14px;
        font-size: 0.85rem;
        box-sizing: border-box;
    }

    .feature-html-wrapper .status {
        margin: 10px;
    }
}
