/* BNM EVO Wallet Verifier - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    color: #1a365d;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: #718096;
    font-size: 0.95rem;
}

.section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section p {
    margin-bottom: 1rem;
    text-align: center;
    color: #4a5568;
}

/* QR Code */
.qr-wrapper {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-wrapper img {
    border: 4px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
}

.engagement-uri {
    text-align: center;
    margin-bottom: 1rem;
    word-break: break-all;
}

.engagement-uri code {
    font-size: 0.75rem;
    color: #a0aec0;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Status Indicator */
.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-pending {
    background: #fefcbf;
    color: #744210;
}
.status-pending .status-dot {
    background: #d69e2e;
    animation: pulse 1.5s infinite;
}

.status-processing {
    background: #bee3f8;
    color: #2a4365;
}
.status-processing .status-dot {
    background: #3182ce;
    animation: pulse 1s infinite;
}

.status-success {
    background: #c6f6d5;
    color: #22543d;
}
.status-success .status-dot {
    background: #38a169;
}

.status-error {
    background: #fed7d7;
    color: #742a2a;
}
.status-error .status-dot {
    background: #e53e3e;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Result Display */
.doc-type {
    text-align: center;
    margin-bottom: 1rem;
    color: #4a5568;
    font-size: 0.9rem;
}

.portrait-wrapper {
    text-align: center;
    margin: 1rem 0 1.5rem;
}

.portrait {
    width: 150px;
    height: auto;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.data-table tr {
    border-bottom: 1px solid #edf2f7;
}

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

.data-table td {
    padding: 0.6rem 0.5rem;
    vertical-align: top;
}

.data-table .label {
    font-weight: 600;
    color: #4a5568;
    width: 40%;
    font-size: 0.85rem;
}

.data-table .value {
    color: #2d3748;
    font-size: 0.9rem;
}

.signature-wrapper {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #edf2f7;
}

.signature-img {
    max-width: 250px;
    height: auto;
    margin-top: 0.5rem;
}

/* Verification Section */
.verification-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.verification-section h3,
.evidence-section h3 {
    font-size: 1.1rem;
    color: #1a365d;
    margin-bottom: 1rem;
}

.verification-table .section-header td {
    background: #edf2f7;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4a5568;
    padding: 0.5rem 0.5rem;
    border-bottom: none;
}

.verification-table code {
    font-size: 0.8rem;
    background: #f7fafc;
    padding: 1px 4px;
    border-radius: 3px;
    word-break: break-all;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-ok {
    background: #c6f6d5;
    color: #22543d;
}

.badge-warn {
    background: #fefcbf;
    color: #744210;
}

.badge-processing {
    background: #bee3f8;
    color: #2a4365;
}

.badge-pending {
    background: #edf2f7;
    color: #4a5568;
}

.badge-error {
    background: #fed7d7;
    color: #742a2a;
}

/* Document Validity Banner */
.doc-validity-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.doc-validity-banner .validity-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.doc-validity-banner.validity-valid {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.doc-validity-banner.validity-warning {
    background: #fefcbf;
    color: #744210;
    border: 1px solid #f6e05e;
}

.doc-validity-banner.validity-invalid {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

.doc-validity-sub {
    font-weight: 400;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

/* Validity Dot in queue item header */
.validity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.validity-dot.dot-valid { background: #38a169; }
.validity-dot.dot-warning { background: #d69e2e; }
.validity-dot.dot-invalid { background: #e53e3e; }

/* Evidence Section */
.evidence-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.evidence-info {
    font-size: 0.85rem;
    color: #718096;
    text-align: left !important;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.evidence-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.element-count {
    text-align: right;
    margin-top: 0.5rem;
    color: #a0aec0;
}

/* Error Box */
.error-box {
    text-align: center;
}

.error-box h2 {
    color: #c53030;
    margin-bottom: 0.5rem;
}

.error-box p {
    color: #742a2a;
}

/* Buttons */
.actions {
    text-align: center;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: #3182ce;
    color: #fff;
}

.btn-primary:hover {
    background: #2b6cb0;
}

.btn-secondary {
    background: #edf2f7;
    color: #2d3748;
    border: 1px solid #cbd5e0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ============================================================
   TELLER SELECTION PAGE
   ============================================================ */

.teller-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.teller-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
}

.teller-card:hover {
    border-color: #3182ce;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
    transform: translateY(-2px);
}

.teller-card-icon {
    color: #3182ce;
    margin-bottom: 0.75rem;
}

.teller-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 0.25rem;
}

.teller-card-location {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.teller-card-mode {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 10px;
    background: #edf2f7;
    color: #4a5568;
}

/* ============================================================
   TELLER PAGE — HEADER + LAYOUT
   ============================================================ */

.teller-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.teller-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.teller-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.teller-header-left h1 {
    font-size: 1.3rem;
    color: #1a365d;
    margin-bottom: 0;
}

.teller-header-left .subtitle {
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.back-link {
    font-size: 1.5rem;
    color: #718096;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1;
}

.back-link:hover {
    background: #edf2f7;
    color: #2d3748;
}

/* Settings bar */
.teller-settings {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle-text {
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e0;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #38a169;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.retention-select {
    padding: 0.35rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #4a5568;
    background: #fff;
    cursor: pointer;
}

.retention-select:focus {
    outline: none;
    border-color: #3182ce;
}

/* Two-column layout */
.teller-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.qr-panel {
    flex: 0 0 340px;
    position: sticky;
    top: 1rem;
}

.queue-panel {
    flex: 1;
    min-width: 0;
}

/* Queue header */
.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.queue-header h2 {
    font-size: 1.15rem;
    color: #1a365d;
}

.queue-count {
    background: #3182ce;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
}

/* Queue list */
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.queue-empty {
    background: #fff;
    border-radius: 8px;
    padding: 3rem 1.5rem;
    text-align: center;
    color: #a0aec0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.queue-empty p {
    margin-bottom: 0.5rem;
}

/* Queue item */
.queue-item {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    border-left: 4px solid #e2e8f0;
    transition: border-color 0.2s;
}

.queue-item.completed {
    border-left-color: #38a169;
}

.queue-item.pending {
    border-left-color: #d69e2e;
}

.queue-item.expanded {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.queue-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    gap: 0.5rem;
}

.queue-item-header:hover {
    background: #f7fafc;
}

.queue-item-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.queue-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.queue-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #edf2f7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #718096;
    flex-shrink: 0;
}

.queue-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.queue-item-info strong,
.queue-item-info em {
    font-size: 0.9rem;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-info em {
    color: #718096;
    font-size: 0.85rem;
}

.queue-item-time {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.15rem;
}

.queue-chevron {
    font-size: 0.7rem;
    color: #a0aec0;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.queue-item.expanded .queue-chevron {
    transform: rotate(180deg);
}

/* Queue item details */
.queue-item-details {
    padding: 0 1rem 1rem;
    border-top: 1px solid #edf2f7;
}

.detail-doc {
    margin-top: 0.75rem;
}

/* Document header — photo + identity + validity */
.doc-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.doc-header-photo {
    flex-shrink: 0;
}

.doc-header-photo .portrait {
    width: 200px;
    height: auto;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.doc-header-info {
    flex: 1;
    min-width: 0;
}

.doc-header-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a365d;
    margin: 0 0 0.3rem 0;
    line-height: 1.3;
}

.doc-header-detail {
    font-size: 0.88rem;
    color: #4a5568;
    margin: 0.15rem 0;
}

.doc-header-detail strong {
    color: #2d3748;
}

.doc-header-doctype {
    font-size: 0.78rem;
    color: #a0aec0;
    margin: 0.35rem 0 0.5rem;
    font-family: monospace;
}

.doc-header-expired {
    color: #e53e3e;
    font-weight: 700;
    font-size: 0.82rem;
}

.doc-header-info .doc-validity-banner {
    margin-bottom: 0;
}

.detail-doc .portrait-wrapper {
    margin: 0.75rem 0;
}

.detail-doc .portrait {
    width: 120px;
}

.detail-doc .doc-header-photo .portrait {
    width: 200px;
}

.detail-doc .data-table .label {
    width: 45%;
    font-size: 0.8rem;
}

.detail-doc .data-table .value {
    font-size: 0.85rem;
}

.detail-doc .data-table td {
    padding: 0.4rem 0.5rem;
}

.verification-mini {
    margin-top: 1rem;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edf2f7;
    flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .teller-layout {
        flex-direction: column;
    }

    .qr-panel {
        flex: none;
        width: 100%;
        position: static;
    }

    .qr-panel .qr-wrapper img {
        width: 200px;
        height: 200px;
    }

    .teller-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .teller-settings {
        width: 100%;
        justify-content: space-between;
    }

    .teller-grid {
        grid-template-columns: 1fr;
    }

    .doc-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .doc-header-info .doc-validity-banner {
        justify-content: center;
    }
}
