/**
 * Peak Lab Batch Verification - Public /verify page styles
 * All classes scoped with .pl-verify- to avoid theme conflicts.
 */

.pl-verify-container {
    --pl-verify-primary: #3AB5FF;
    --pl-verify-primary-hover: #2891C9;
    --pl-verify-navy: #36465C;
    --pl-verify-success: #059669;
    --pl-verify-bg-tint: #F5F7FA;
    --pl-verify-light-blue: #EFF6FF;
    --pl-verify-border: #e5e7eb;
    --pl-verify-text: #1f2937;
    --pl-verify-text-muted: #6b7280;

    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--pl-verify-text);
    box-sizing: border-box;
}

.pl-verify-container * { box-sizing: border-box; }

/* Header */
.pl-verify-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.pl-verify-shield {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #3AB5FF 0%, #2891C9 100%);
    color: #fff;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(58, 181, 255, 0.3);
}

.pl-verify-title {
    color: var(--pl-verify-navy) !important;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.pl-verify-subtitle {
    color: var(--pl-verify-text-muted);
    font-size: 1.0625rem;
    line-height: 1.5;
    margin: 0 auto;
    max-width: 560px;
}

/* "Search for another batch" link — shown when a result card is displayed
   and the two full lookup forms are collapsed. Subtle centered text link,
   not a button. Peak Lab muted register. */
.pl-verify-expand-link {
    margin: 0.5rem 0 2rem;
    text-align: center;
}

.pl-verify-expand-trigger {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pl-verify-muted, #6b7280) !important;
    text-decoration: none;
    letter-spacing: 0.01em;
    padding: 0.375rem 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.pl-verify-expand-trigger:hover,
.pl-verify-expand-trigger:focus {
    color: var(--pl-verify-navy, #36465C) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    background: transparent;
}

.pl-verify-expand-trigger:focus-visible {
    outline: 2px solid var(--pl-verify-primary, #3AB5FF);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Lookup grid */
.pl-verify-lookup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Native [hidden] attribute is what our JS toggles.
   Belt-and-suspenders — some themes override display: none on [hidden]. */
.pl-verify-lookup-grid[hidden],
.pl-verify-expand-link[hidden] {
    display: none !important;
}

.pl-verify-lookup-card {
    background: #fff;
    border: 1px solid var(--pl-verify-border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pl-verify-lookup-title {
    color: var(--pl-verify-navy) !important;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.pl-verify-lookup-desc {
    color: var(--pl-verify-text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.pl-verify-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pl-verify-label {
    color: var(--pl-verify-navy);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
}

.pl-verify-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--pl-verify-text);
    background: #fff;
    transition: all 0.2s ease;
}

.pl-verify-input:focus {
    outline: none;
    border-color: var(--pl-verify-primary);
    box-shadow: 0 0 0 3px rgba(58, 181, 255, 0.15);
}

.pl-verify-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3AB5FF 0%, #2891C9 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(58, 181, 255, 0.3);
    margin-top: 0.5rem;
    text-decoration: none;
}

.pl-verify-button:hover,
.pl-verify-button:focus {
    background: linear-gradient(135deg, #2891C9 0%, #36465C 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 181, 255, 0.4);
    color: #fff !important;
}

.pl-verify-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Status region (loading + status messages) */
.pl-verify-status {
    text-align: center;
    color: var(--pl-verify-text-muted);
    font-size: 0.9375rem;
    margin: 1rem 0;
    min-height: 1.25rem;
}

.pl-verify-status.is-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid var(--pl-verify-border);
    border-top-color: var(--pl-verify-primary);
    border-radius: 50%;
    animation: pl-verify-spin 0.8s linear infinite;
}

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

/* Results */
.pl-verify-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.pl-verify-card {
    background: #fff;
    border: 1px solid var(--pl-verify-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Wrapper for URL-triggered auto-lookup result.
   Gives the result card breathing room from the form below
   and matches the normal results container spacing. */
.pl-verify-auto-result {
    margin: 0 0 2.5rem;
}

.pl-verify-auto-result .pl-verify-card,
.pl-verify-auto-result .pl-verify-not-found {
    margin-top: 0;
}

.pl-verify-not-found--url {
    max-width: 640px;
    margin: 0 auto;
}

.pl-verify-not-found--url code {
    background: rgba(58, 181, 255, 0.1);
    color: var(--pl-verify-primary, #2891C9);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

.pl-verify-card-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pl-verify-check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
}

.pl-verify-card-body {
    padding: 1.5rem;
}

.pl-verify-details {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    margin: 0;
}

.pl-verify-details dt {
    color: var(--pl-verify-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.pl-verify-details dd {
    color: var(--pl-verify-text);
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.4;
}

.pl-verify-details dd code {
    background: var(--pl-verify-bg-tint);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--pl-verify-navy);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.pl-verify-card-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: nowrap;
    border-top: 1px solid var(--pl-verify-border);
    margin-top: 0.5rem;
}

/* Both buttons share the row equally and fill the footer width. */
.pl-verify-card-footer .pl-verify-btn {
    flex: 1 1 0;
    min-width: 0;
}

.pl-verify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    /* Transparent border matches the 2px border on secondary buttons,
       so heights stay identical when they sit side by side. */
    border: 2px solid transparent;
    font-family: inherit;
    text-align: center;
    white-space: nowrap;
}

.pl-verify-btn-primary {
    background: linear-gradient(135deg, #3AB5FF 0%, #2891C9 100%);
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(58, 181, 255, 0.3);
}

.pl-verify-btn-primary:hover,
.pl-verify-btn-primary:focus {
    background: linear-gradient(135deg, #2891C9 0%, #36465C 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 181, 255, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.pl-verify-btn-secondary {
    background: transparent;
    color: var(--pl-verify-primary-hover) !important;
    border: 2px solid var(--pl-verify-primary);
    text-decoration: none;
}

.pl-verify-btn-secondary:hover,
.pl-verify-btn-secondary:focus {
    background: var(--pl-verify-light-blue);
    color: var(--pl-verify-navy) !important;
    text-decoration: none;
}

/* Not found state */
.pl-verify-not-found {
    background: var(--pl-verify-bg-tint);
    border: 1px solid var(--pl-verify-border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.pl-verify-not-found-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    color: var(--pl-verify-text-muted);
    background: #fff;
    border: 1px solid var(--pl-verify-border);
    border-radius: 50%;
    margin-bottom: 1rem;
}

.pl-verify-not-found-message {
    color: var(--pl-verify-text);
    font-size: 1rem;
    line-height: 1.55;
    max-width: 480px;
    margin: 0 auto;
}

.pl-verify-not-found-message a {
    color: var(--pl-verify-primary-hover);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(40, 145, 201, 0.35);
    transition: all 0.2s ease;
}

.pl-verify-not-found-message a:hover {
    color: var(--pl-verify-primary);
    border-bottom-color: var(--pl-verify-primary);
}

/* Modal */
.pl-verify-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pl-verify-modal[hidden] { display: none; }

.pl-verify-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.75);
    cursor: pointer;
}

.pl-verify-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.pl-verify-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pl-verify-border);
    background: var(--pl-verify-bg-tint);
}

.pl-verify-modal-title {
    color: var(--pl-verify-navy) !important;
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0;
}

.pl-verify-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--pl-verify-text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.pl-verify-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--pl-verify-text);
}

.pl-verify-modal-body {
    flex: 1;
    min-height: 400px;
    background: #f3f4f6;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.pl-verify-modal-body iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 60vh;
    border: none;
}

.pl-verify-modal-body iframe[hidden] { display: none; }

.pl-verify-modal-body img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pl-verify-modal-body img[hidden] { display: none; }

.pl-verify-modal-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--pl-verify-border);
    display: flex;
    justify-content: flex-end;
}

.pl-verify-modal-download {
    display: inline-flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #3AB5FF 0%, #2891C9 100%);
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pl-verify-modal-download:hover {
    background: linear-gradient(135deg, #2891C9 0%, #36465C 100%);
    color: #fff !important;
    text-decoration: none;
}

/* Mobile */
@media (max-width: 720px) {
    .pl-verify-container { padding: 1.5rem 1rem 3rem; }
    .pl-verify-title { font-size: 1.75rem; }
    .pl-verify-subtitle { font-size: 0.9375rem; }

    .pl-verify-lookup-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pl-verify-lookup-card { padding: 1.25rem; }
    .pl-verify-lookup-title { font-size: 1.125rem; }

    .pl-verify-details {
        grid-template-columns: 1fr;
        gap: 0.125rem 0;
    }

    .pl-verify-details dt {
        margin-top: 0.75rem;
        font-size: 0.8125rem;
    }
    .pl-verify-details dt:first-of-type { margin-top: 0; }

    /* Buttons stay side-by-side on mobile per spec.
       Tighten padding and font-size so both labels fit at narrow widths. */
    .pl-verify-card-footer {
        padding: 1rem 1rem 1.25rem;
        gap: 0.5rem;
    }
    .pl-verify-card-footer .pl-verify-btn {
        padding: 0.6875rem 0.5rem;
        font-size: 0.875rem;
    }

    .pl-verify-modal-content { max-height: 95vh; }
    .pl-verify-modal-body iframe { min-height: 70vh; }
}
