/* ── Member Check — All Styles ──────────────────────────────────────── */

:root {
    --mc-blue:    #1a56db;
    --mc-green:   #057a55;
    --mc-red:     #c81e1e;
    --mc-gray:    #6b7280;
    --mc-border:  #e5e7eb;
    --mc-bg:      #f9fafb;
    --mc-radius:  10px;
    --mc-shadow:  0 2px 16px rgba(0,0,0,.08);
}

/* ── Search / Verify widget ─────────────────────────────────────────── */

.mc-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 700px;
    margin: 2rem auto;
}

.mc-card {
    background: #fff;
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
}

.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.25rem;
    background: var(--mc-blue);
    color: #fff;
}

.mc-title { font-size: 1rem; font-weight: 600; }

.mc-lang-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    border-radius: 6px;
    padding: .28rem .7rem;
    font-size: .78rem;
    cursor: pointer;
    transition: background .2s;
}
.mc-lang-btn:hover { background: rgba(255,255,255,.3); }

.mc-body { padding: 1.25rem; }

.mc-search-section { margin-bottom: .75rem; }

.mc-section-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--mc-gray);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .4rem;
}

.mc-or-divider {
    text-align: center;
    margin: .75rem 0;
    position: relative;
    color: var(--mc-gray);
    font-size: .82rem;
}
.mc-or-divider::before,
.mc-or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 44%;
    height: 1px;
    background: var(--mc-border);
}
.mc-or-divider::before { left: 0; }
.mc-or-divider::after  { right: 0; }

.mc-row {
    display: flex;
    gap: .5rem;
}

.mc-input {
    flex: 1;
    padding: .6rem .9rem;
    border: 1px solid var(--mc-border);
    border-radius: 6px;
    font-size: .92rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.mc-input:focus {
    border-color: var(--mc-blue);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.mc-search-btn {
    padding: .6rem 1rem;
    background: var(--mc-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
    font-family: inherit;
}
.mc-search-btn:hover    { background: #1648c0; }
.mc-search-btn:disabled { opacity: .55; cursor: default; }

/* Result */
.mc-result { margin-top: .9rem; }

.mc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .9rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: .75rem;
}
.mc-status-badge.found {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--mc-green);
}
.mc-status-badge.not-found {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--mc-red);
}

.mc-member-card {
    background: var(--mc-bg);
    border: 1px solid var(--mc-border);
    border-radius: 8px;
    padding: .85rem 1rem;
    margin-bottom: .6rem;
}
.mc-member-row {
    display: flex;
    gap: .5rem;
    margin-bottom: .3rem;
    font-size: .87rem;
}
.mc-member-row:last-child { margin-bottom: 0; }
.mc-label { color: var(--mc-gray); min-width: 120px; flex-shrink: 0; }
.mc-value { color: #111827; font-weight: 500; }

.mc-status-pill {
    display: inline-block;
    padding: .12rem .5rem;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 600;
}
.mc-status-pill.active   { background: #d1fae5; color: #065f46; }
.mc-status-pill.inactive { background: #fee2e2; color: #991b1b; }

.mc-profile-link {
    display: inline-block;
    margin-top: .5rem;
    font-size: .85rem;
    color: var(--mc-blue);
    text-decoration: none;
    font-weight: 500;
}
.mc-profile-link:hover { text-decoration: underline; }

.mc-warning {
    font-size: .85rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: .5rem .8rem;
}
.mc-searching {
    color: var(--mc-gray);
    font-size: .88rem;
    padding: .35rem 0;
}

/* ── Member Public Page ─────────────────────────────────────────────── */

.mc-member-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    padding: 2rem 1rem;
}

.mc-mp-wrap {
    display: flex;
    gap: 2.5rem;
    max-width: 860px;
    margin: 0 auto;
    align-items: flex-start;
}

/* Left column */
.mc-mp-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 160px;
}

.mc-mp-logo img {
    max-width: 140px;
    max-height: 80px;
    object-fit: contain;
}

.mc-mp-photo img {
    width: 140px;
    height: 175px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--mc-border);
}

.mc-mp-qr img {
    display: block;
    border: 1px solid var(--mc-border);
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

.mc-mp-dl-btn {
    display: block;
    width: 100%;
    padding: .55rem .75rem;
    background: var(--mc-blue);
    color: #fff;
    border-radius: 6px;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .2s;
}
.mc-mp-dl-btn:hover { background: #1648c0; color: #fff; }

/* Right column */
.mc-mp-right {
    flex: 1;
    min-width: 0;
}

.mc-mp-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .4rem .9rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: .88rem;
    margin-bottom: 1rem;
}
.mc-mp-status.active   { background: #f0fdf4; border: 1px solid #bbf7d0; color: var(--mc-green); }
.mc-mp-status.inactive { background: #fef2f2; border: 1px solid #fecaca; color: var(--mc-red); }

.mc-mp-name-uk {
    font-size: 1.55rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 .25rem;
    line-height: 1.2;
}
.mc-mp-name-en {
    font-size: 1.05rem;
    color: var(--mc-gray);
    margin: 0 0 .3rem;
}
.mc-mp-degree {
    font-size: .92rem;
    color: #374151;
    font-style: italic;
    margin: 0;
}

.mc-mp-divider {
    height: 1px;
    background: var(--mc-border);
    margin: 1rem 0;
}

.mc-mp-fields { margin: 0; }
.mc-mp-field {
    display: flex;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--mc-bg);
    font-size: .9rem;
}
.mc-mp-field dt {
    color: var(--mc-gray);
    min-width: 130px;
    flex-shrink: 0;
    font-weight: normal;
}
.mc-mp-field dd {
    margin: 0;
    color: #111827;
    font-weight: 500;
    word-break: break-word;
}
.mc-mp-field dd a { color: var(--mc-blue); text-decoration: none; }
.mc-mp-field dd a:hover { text-decoration: underline; }

.mc-mp-meta { background: var(--mc-bg); border-radius: 8px; padding: .85rem 1rem; }
.mc-mp-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .3rem 0;
    font-size: .88rem;
}
.mc-mp-meta-label { min-width: 120px; color: var(--mc-gray); }
.mc-mp-meta-value { font-weight: 600; color: #111827; }
.mc-mp-id {
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    background: #fff;
    border: 1px solid var(--mc-border);
    padding: .15rem .4rem;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .mc-mp-wrap { flex-direction: column; }
    .mc-mp-left { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}

/* ── Certificate (PDF source) ───────────────────────────────────────── */

#mc-certificate { display: none; }

.mc-cert-wrap {
    width: 559px; /* A5 landscape ~148mm @ 96dpi */
    height: 396px;
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid #ccc;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

.mc-cert-left {
    width: 150px;
    min-width: 150px;
    background: #1a3a6b;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    gap: 10px;
}

.mc-cert-logo img {
    max-width: 110px;
    max-height: 55px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.mc-cert-photo img {
    width: 100px;
    height: 126px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.4);
    border-radius: 3px;
}
.mc-cert-photo--empty {
    width: 100px;
    height: 126px;
    background: rgba(255,255,255,.1);
    border: 2px dashed rgba(255,255,255,.3);
    border-radius: 3px;
}

.mc-cert-qr img {
    background: #fff;
    padding: 3px;
    border-radius: 3px;
}

.mc-cert-right {
    flex: 1;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mc-cert-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}
.mc-cert-org {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #1a3a6b;
}
.mc-cert-title {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mc-cert-name-uk { font-size: 15px; font-weight: 700; color: #111; margin-bottom: 2px; }
.mc-cert-name-en { font-size: 11px; color: #555; margin-bottom: 2px; }
.mc-cert-degree  { font-size: 10px; color: #374151; font-style: italic; }

.mc-cert-divider { height: 1px; background: #e5e7eb; margin: 10px 0; }

.mc-cert-fields  { flex: 1; }
.mc-cert-row {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 9.5px;
    align-items: baseline;
}
.mc-cert-label { color: #6b7280; min-width: 100px; }
.mc-cert-val   { color: #111; font-weight: 600; }
.mc-cert-val--id {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
}
.mc-cert-status.active   { color: #057a55; }
.mc-cert-status.inactive { color: #c81e1e; }

/* ── Search result card (logo + photo + QR + data) ─────────────────── */

.mc-member-card {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid var(--mc-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: .75rem;
}

.mc-card-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: #1a3a6b;
    min-width: 150px;
    width: 150px;
}


.mc-card-photo--empty {
    width: 160px;
    height: 200px;
    background: rgba(255,255,255,.08);
    border: 2px dashed rgba(255,255,255,.25);
    border-radius: 3px;
}

.mc-card-right {
    position: relative;
    flex: 1;
    padding: 14px 16px;
    min-width: 0;
}

.mc-card-right-logo img {
    position: absolute;
    top: 0;
    right: 0;    
    width: 100px;    
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 3px;
}

.mc-card-right-qr img {
    background: #fff;
    padding: 3px;
    border-radius: 3px;
    display: block;
    position: absolute;
    bottom: 0;
    right: 0;    
}

.mc-card-name-uk {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 2px;
    line-height: 1.25;
}

.mc-card-name-en {
    font-size: .88rem;
    color: var(--mc-gray);
    margin-bottom: 2px;
}

.mc-card-degree {
    font-size: .82rem;
    color: #374151;
    font-style: italic;
    margin-bottom: 4px;
}

.mc-card-position {
    font-size: .85rem;
    color: #374151;
    margin-bottom: 2px;
}

.mc-card-divider {
    height: 1px;
    background: var(--mc-border);
    margin: 8px 0;
}

.mc-card-fields {
    margin-bottom: 8px;
}

.mc-mp-status.active   { color: #057a55; font-weight: 600; }
.mc-mp-status.inactive { color: #c81e1e; font-weight: 600; }
.mc-mp-lang-en { opacity: .92; }

/* ── Member page updates ─────────────────────────────────────────────── */

/* Logo — top right of right column */
.mc-mp-right-top {
    display: flex;
    flex-direction: row;
    align-items: center;
}
.mc-mp-logo {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.mc-mp-logo img {
    max-height: 80px;
    max-width: 140px;
    object-fit: contain;
}

/* Status badge under photo */
.mc-mp-status-badge {
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 5px;
    width: 100%;
}
.mc-mp-status-badge.active {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.mc-mp-status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Photo placeholder */
.mc-mp-photo--empty {
    width: 140px;
    height: 175px;
    background: rgba(255,255,255,.08);
    border: 2px dashed rgba(255,255,255,.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Position style for search card */
.mc-card-position {
    font-size: .85rem;
    color: #374151;
    margin-bottom: 2px;
}

/* Member page status in meta */
.mc-mp-status.active   { color: #057a55; font-weight: 600; }
.mc-mp-status.inactive { color: #c81e1e; font-weight: 600; }

@media (max-width: 480px) {
    .mc-member-card { flex-direction: column; }
    .mc-card-left {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}
