/* =========================================================
   GetCID – Frontend Styles
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset & Base ──────────────────────────────────────── */
.getcid-wrapper *,
.getcid-wrapper *::before,
.getcid-wrapper *::after {
    box-sizing: border-box;
}


.getcid-wrapper {
    --gc-primary:       #0c3051;
    --gc-primary-dark:  #0a2540;
    --gc-accent:        #0c3051;
    --gc-success:       #16a34a;
    --gc-success-light: #f0fdf4;
    --gc-error:         #dc2626;
    --gc-error-light:   #fef2f2;
    --gc-border:        #d1d5db;
    --gc-bg:            #f8fafc;
    --gc-seg-bg:        #f1f3f5;
    --gc-seg-border:    #ced4da;
    --gc-text:          #111827;
    --gc-muted:         #6b7280;
    --gc-radius:        10px;
    --gc-shadow:        0 2px 12px rgba(0,0,0,.07);
    --gc-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    font-family: var(--gc-font);
    color: var(--gc-text);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 8px 0;
}

/* ── Cards ─────────────────────────────────────────────── */
.getcid-card {
    background: #fff;
    border: 1px solid var(--gc-border);
    border-radius: var(--gc-radius);
    box-shadow: var(--gc-shadow);
    padding: 28px 32px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.getcid-card--locked {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Card Header ────────────────────────────────────────── */
.getcid-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gc-border);
}

.getcid-header-icon {
    width: 36px;
    height: 36px;
    color: var(--gc-accent);
    flex-shrink: 0;
}

.getcid-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--gc-primary);
    line-height: 1.2;
}

.getcid-subtitle {
    font-size: 0.82rem;
    color: var(--gc-muted);
    margin: 0;
}

/* ── Step 1: 70 / 30 Grid ───────────────────────────────── */
.getcid-step1-grid {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 24px;
    align-items: center;   /* vertically centre both columns */
}

.getcid-step1-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.getcid-step1-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Info placeholder – no bulky box, just centred muted text */
.getcid-info-box {
    width: 100%;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.getcid-info-box:not(.getcid-info-box--success) {
    background: transparent;
    border: none;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: var(--gc-muted);
    font-style: italic;
    font-size: 0.8rem;
}

.getcid-info-box svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gc-border);
}

/* Success state */
.getcid-info-box--success {
    background: var(--gc-success-light);
    border: 1px solid #bbf7d0;
    gap: 8px;
}

.getcid-info-divider {
    height: 1px;
    background: #bbf7d0;
    margin: 2px 0;
}

.getcid-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.getcid-info-label {
    font-size: 0.78rem;
    color: var(--gc-muted);
    font-weight: 500;
    white-space: nowrap;
}

.getcid-info-value {
    font-size: 0.85rem;
    color: var(--gc-primary);
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

/* ── Labels ─────────────────────────────────────────────── */
.getcid-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gc-primary);
    margin-bottom: 8px;
}

.getcid-label__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gc-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Hint text ──────────────────────────────────────────── */
.getcid-hint {
    font-size: 0.82rem;
    color: var(--gc-muted);
    margin: 0 0 14px;
    line-height: 1.55;
}

/* ── Input row (order number) ───────────────────────────── */
.getcid-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.getcid-input {
    flex: 1;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--gc-border);
    border-radius: 6px;
    font-size: 0.92rem;
    font-family: var(--gc-font);
    color: var(--gc-text);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    min-width: 0;
}

.getcid-input:focus {
    border-color: var(--gc-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Buttons ─────────────────────────────────────────────── */
.getcid-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 20px;
    height: 46px;
    border: none;
    border-radius: 6px;
    font-family: var(--gc-font);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background .18s, transform .12s, box-shadow .18s;
    white-space: nowrap;
    flex-shrink: 0;
}

.getcid-btn:active { transform: translateY(1px); }

.getcid-btn--primary {
    background: var(--gc-accent);
    color: #fff;
}
.getcid-btn--primary:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

.getcid-btn--dark {
    background: var(--gc-primary);
    color: #fff;
}
.getcid-btn--dark:hover:not(:disabled) {
    background: var(--gc-primary-dark);
    box-shadow: 0 4px 14px rgba(26,39,68,.35);
}

.getcid-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Spinner ─────────────────────────────────────────────── */
.btn-spinner {
    width: 15px;
    height: 15px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gc-spin 0.7s linear infinite;
}

@keyframes gc-spin {
    to { transform: rotate(360deg); }
}

/* ── Messages ────────────────────────────────────────────── */
.getcid-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.4;
}

/* When the message is inside the right panel, flush with other boxes */
.getcid-step1-right .getcid-message {
    margin-top: 0;
}

.getcid-message.is-error {
    background: var(--gc-error-light);
    color: var(--gc-error);
    border-left: 3px solid var(--gc-error);
}

.getcid-message.is-success {
    background: var(--gc-success-light);
    color: var(--gc-success);
    border-left: 3px solid var(--gc-success);
}

/* ── Badge ───────────────────────────────────────────────── */
.getcid-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.getcid-badge--success {
    background: #dcfce7;
    color: var(--gc-success);
}

/* ═══════════════════════════════════════════════════════════
   UNIFIED SEGMENT ROW  –  used by BOTH Step 2 (IID input)
   and Step 3 (CID display). Same height, same spacing,
   same button placement.
   ═══════════════════════════════════════════════════════════ */
.getcid-seg-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* ── Step 2: editable input cells ───────────────────────── */
.getcid-seg-input {
    flex: 1 1 0;
    min-width: 66px;
    max-width: 90px;
    height: 46px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.03em;
    border: 1.5px solid var(--gc-seg-border);
    border-radius: 6px;
    background: var(--gc-seg-bg);
    color: var(--gc-text);
    transition: border-color .2s, background .2s, box-shadow .2s;
    outline: none;
}

.getcid-seg-input:not(:disabled) {
    background: #fff;
}

.getcid-seg-input:focus {
    border-color: var(--gc-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(12,48,81,.12);
}

/* ── Step 3: read-only display cells (same look as inputs) ─ */
.getcid-cid-seg {
    flex: 1 1 0;
    min-width: 66px;
    max-width: 90px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--gc-seg-border);
    border-radius: 6px;
    background: var(--gc-seg-bg);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gc-text);
    letter-spacing: 0.03em;
    transition: background .3s, border-color .3s;
}

.getcid-cid-seg.is-filled {
    background: #fff;
    border-color: var(--gc-primary);
    animation: gc-pop 0.25s ease;
}

@keyframes gc-pop {
    0%   { transform: scale(0.9); }
    60%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Button sits at end of the shared seg row */
.getcid-seg-row .getcid-btn {
    flex-shrink: 0;
    height: 46px;
    align-self: center;
}

/* ── Copy notice ─────────────────────────────────────────── */
.getcid-copy-notice {
    margin-top: 10px;
    padding: 9px 14px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--gc-success);
    background: var(--gc-success-light);
    border-left: 3px solid var(--gc-success);
    border-radius: 6px;
    animation: gc-fadein 0.2s ease;
}

@keyframes gc-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .getcid-card { padding: 20px 16px; }

    /* Step 1: stack on narrow screens */
    .getcid-step1-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .getcid-seg-input,
    .getcid-cid-seg {
        min-width: 52px;
        height: 40px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .getcid-seg-input,
    .getcid-cid-seg { min-width: 42px; font-size: 0.78rem; }
}
