/* =========================================================
   Certificate Verifier — Frontend Styles (English Edition)
   Modern minimal design — distinct visual language from the
   original theme. Field order is unchanged.
   ========================================================= */

/* ── Accessibility Helper ───────────────────────────────── */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Container ──────────────────────────────────────────── */
.cert-verifier-wrap {
    --cv-accent:      #4f46e5;
    --cv-accent-dark: #4338ca;
    --cv-success:     #059669;
    --cv-success-bg:  #ecfdf5;
    --cv-error:       #e11d48;
    --cv-error-bg:    #fff1f2;
    --cv-ink:         #1e1b2e;
    --cv-muted:       #6b7280;
    --cv-line:        #e5e7eb;

    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    direction: ltr;
    text-align: left;
    color: var(--cv-ink);
}

/* ── Header ─────────────────────────────────────────────── */
.cert-header {
    text-align: center;
    margin-bottom: 28px;
}

.cert-shield-icon {
    font-size: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--cv-accent), var(--cv-accent-dark));
    border-radius: 20px;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}

.cert-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--cv-ink);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.cert-subtitle {
    color: var(--cv-muted);
    font-size: 15px;
    margin: 0 auto;
    max-width: 440px;
    line-height: 1.5;
}

/* ── Search Box ─────────────────────────────────────────── */
.cert-search-box {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    background: #fff;
    border: 1px solid var(--cv-line);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cert-search-box input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15.5px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    letter-spacing: 0.3px;
    outline: none;
    color: var(--cv-ink);
}

.cert-search-box input:focus {
    background: #f5f5ff;
}

.cert-search-box input::placeholder {
    color: #b3b3c2;
    letter-spacing: 0;
    font-family: inherit;
}

#cert-verify-btn {
    flex-shrink: 0;
    padding: 12px 24px;
    background: var(--cv-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    font-family: inherit;
}

#cert-verify-btn:hover:not(:disabled) {
    background: var(--cv-accent-dark);
}

#cert-verify-btn:active:not(:disabled) {
    transform: scale(0.97);
}

#cert-verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Result Container ───────────────────────────────────── */
#cert-result {
    border-radius: 16px;
    overflow: hidden;
    animation: cvFadeIn 0.3s ease;
}

@keyframes cvFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Success State ──────────────────────────────────────── */
.cert-success {
    border: 1px solid #b8f0d6;
    background: #fff;
}

.cert-valid-header {
    background: var(--cv-success-bg);
    padding: 24px 28px 20px;
    text-align: left;
    border-bottom: 1px solid #b8f0d6;
}

.cert-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    font-size: 18px;
    background: var(--cv-success);
    color: #fff;
    border-radius: 50%;
    margin-bottom: 12px;
}

.cert-valid-header h3 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 800;
    color: #065f46;
}

.cert-valid-sub {
    margin: 0;
    font-size: 13.5px;
    color: #0d7a57;
}

/* ── Certificate Data — Definition-List Style ───────────── */
.cert-table {
    width: 100%;
    border-collapse: collapse;
}

.cert-table tbody {
    display: block;
}

.cert-table tr {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--cv-line);
    transition: background 0.12s;
}

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

.cert-table tr:hover {
    background: #fafafa;
}

.cert-table th {
    flex: 0 0 auto;
    text-align: left;
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cv-muted);
    padding: 0;
    border: none;
    white-space: nowrap;
}

.cert-table td {
    flex: 1;
    text-align: right;
    font-weight: 600;
    font-size: 15px;
    color: var(--cv-ink);
    padding: 0;
    border: none;
}

.cert-verified-at {
    text-align: center;
    font-size: 11.5px;
    color: #9ca3af;
    margin: 0;
    padding: 12px;
    background: #fafafa;
    border-top: 1px solid var(--cv-line);
}

/* ── Certificate Image (Full Size) ──────────────────────── */
.cert-image-wrap {
    padding: 24px 28px;
    text-align: center;
    background: #fff;
    border-top: 1px solid var(--cv-line);
}

.cert-image-label {
    font-weight: 700;
    color: var(--cv-ink);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 14px;
}

.cert-image-link {
    display: inline-block;
    cursor: zoom-in;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--cv-line);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.cert-image-link:hover {
    border-color: var(--cv-accent);
    box-shadow: 0 6px 18px rgba(79, 70, 229, 0.15);
}

.cert-full-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 11px;
}

.cert-image-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--cv-muted);
}

/* ── Error State ────────────────────────────────────────── */
.cert-error {
    border: 1px solid #fecdd3;
    background: var(--cv-error-bg);
}

.cert-invalid {
    padding: 32px 28px;
    text-align: center;
}

.cert-error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 18px;
    background: var(--cv-error);
    color: #fff;
    border-radius: 50%;
    margin-bottom: 14px;
}

.cert-invalid p {
    color: #9f1239;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
}

/* ── Lightbox (full original-size image viewer) ───────────── */
.cert-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 14, 28, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 30px;
    box-sizing: border-box;
    animation: cvFadeIn 0.2s ease;
}

.cert-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cert-lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.cert-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .cert-search-box {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }

    #cert-verify-btn {
        width: 100%;
    }

    .cert-table tr {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 20px;
    }

    .cert-table td {
        text-align: left;
    }

    .cert-header h2 {
        font-size: 22px;
    }

    .cert-lightbox-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }
}
