/* ==========================================================================
   TERMINAL PAIRING SCREEN - RESPONSIVE CENTERED QR LAYOUT
   ========================================================================== */

.terminal-pairing-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 48px);
    min-height: calc(100dvh - 48px);
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.terminal-pairing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: clamp(280px, 85vw, 440px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: clamp(16px, 4vw, 28px);
    text-align: center;
    box-sizing: border-box;
    margin: auto;
}

.terminal-pairing-header {
    width: 100%;
    margin-bottom: clamp(12px, 2.5vw, 18px);
}

.terminal-pairing-title {
    font-size: clamp(16px, 3.5vw, 20px);
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terminal-pairing-code-badge {
    display: inline-block;
    max-width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 10px;
    box-sizing: border-box;
}

.terminal-pairing-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.5px;
    word-break: break-all;
    overflow-wrap: anywhere;
    user-select: all;
}

.terminal-pairing-qr-box {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: clamp(8px, 2vw, 16px);
    background: #ffffff;
    border-radius: 12px;
    box-sizing: border-box;
}

.terminal-pairing-qr {
    display: block;
    width: clamp(180px, 42vmin, 320px);
    height: clamp(180px, 42vmin, 320px);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 8px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
}

.terminal-pairing-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: clamp(180px, 40vmin, 260px);
    font-size: clamp(13px, 3vw, 15px);
    color: #64748b;
    gap: 8px;
}

.terminal-pairing-footer {
    width: 100%;
    margin-top: clamp(12px, 2.5vw, 18px);
    padding-top: clamp(8px, 2vw, 12px);
    border-top: 1px solid #f1f5f9;
}

.terminal-pairing-hint {
    font-size: clamp(11px, 2.5vw, 13px);
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Screen Size Specific Refinements */
@media (max-width: 480px) {
    .terminal-pairing-wrapper {
        padding: 10px;
    }

    .terminal-pairing-card {
        padding: 14px 10px;
        border-radius: 12px;
    }

    .terminal-pairing-qr {
        width: clamp(160px, 58vw, 220px);
        height: clamp(160px, 58vw, 220px);
    }
}

@media (min-width: 1025px) and (min-height: 700px) {
    .terminal-pairing-card {
        max-width: 460px;
        padding: 32px 24px;
    }

    .terminal-pairing-qr {
        width: clamp(240px, 32vmin, 350px);
        height: clamp(240px, 32vmin, 350px);
    }
}