:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #687386;
    --line: #dbe2ee;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b42318;
    --warning: #b54708;
    --success: #067647;
    --info: #175cd3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 72px;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr minmax(320px, 420px);
    gap: 32px;
    align-items: center;
    min-height: calc(100vh - 140px);
}

.brand-panel h1,
.topbar h1 {
    margin: 8px 0;
    font-size: 42px;
    line-height: 1.1;
}

.brand-panel p {
    max-width: 520px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.eyebrow {
    margin: 0;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.form-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
    padding: 28px;
}

.form-card h2,
.panel h2 {
    margin: 0 0 22px;
    font-size: 24px;
}

label {
    display: block;
    margin-bottom: 16px;
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

input,
textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 12px 13px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}

textarea {
    resize: vertical;
}

button,
.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    color: #ffffff;
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button:hover,
.button-secondary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

button:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.button-secondary {
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line);
}

.button-secondary:hover {
    color: var(--ink);
    background: #eef4f8;
}

.small-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.button-compact {
    min-height: 30px;
    padding: 0 10px;
}

.form-links {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    font-size: 14px;
}

.single-card {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 140px);
}

.single-card .form-card {
    width: min(420px, 100%);
}

.flash-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100% - 36px));
}

.flash {
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--info);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.12);
}

.flash-success {
    border-left-color: var(--success);
}

.flash-danger {
    border-left-color: var(--danger);
}

.flash-warning {
    border-left-color: var(--warning);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.summary-item {
    min-width: 0;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.summary-item span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

.summary-item strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 17px;
}

.secret-code {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secret-code strong {
    min-width: 64px;
}

.confidential-note {
    margin: 10px 0 0;
    color: #7a2e0e;
    font-size: 13px;
    line-height: 1.4;
}

.workspace {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

.muted {
    color: var(--muted);
    line-height: 1.5;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: #475467;
    font-size: 13px;
}

/* Sticky Actions column */
#results-table th:last-child,
#results-table td:last-child {
    position: sticky;
    right: 0;
    background: var(--surface);
    z-index: 1;
}

#results-table thead th:last-child {
    background: var(--surface);
    z-index: 2;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-in-progress {
    color: #7a2e0e;
    background: #fff4e5;
}

.status-completed {
    color: #075e45;
    background: #e7f8f0;
}

.report-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding: 18px 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons .small-button {
    white-space: nowrap;
}

.result-count {
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.result-count strong {
    color: var(--ink);
    font-weight: 700;
}

.view-link {
    display: inline-block;
    padding: 6px 12px;
    color: var(--primary-dark);
    background: #f0f7f6;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
}

.view-link:hover {
    background: #e0efec;
    text-decoration: none;
}

/* Test Quota Section */
.quota-section {
    margin-bottom: 24px;
}

.quota-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

.quota-panel h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--ink);
}

.quota-info {
    margin-bottom: 20px;
}

.quota-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quota-label {
    color: var(--muted);
    font-size: 14px;
}

.quota-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.quota-bar-container {
    width: 100%;
    height: 24px;
    background: #e8eef5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.quota-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    transition: width 0.3s ease;
}

.quota-warning {
    padding: 12px;
    background: #fef2e8;
    border-left: 4px solid var(--warning);
    color: #974c04;
    border-radius: 4px;
    font-size: 14px;
}

.quota-caution {
    padding: 12px;
    background: #fff9e6;
    border-left: 4px solid #fbbf24;
    color: #78350f;
    border-radius: 4px;
    font-size: 14px;
}

.quota-actions {
    text-align: center;
}

/* Get More Tests Section */
.get-more-tests-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid var(--line);
}

.get-more-tests-panel {
    background: linear-gradient(135deg, #f0f7f6 0%, #e8f5f3 100%);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 32px;
    text-align: center;
}

.get-more-tests-panel h3 {
    margin: 0 0 12px;
    font-size: 22px;
    color: var(--ink);
}

.get-more-tests-panel p {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(23, 32, 51, 0.06);
}

.contact-icon {
    font-size: 32px;
}

.contact-details {
    text-align: left;
}

.contact-details strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    margin-bottom: 4px;
}

.contact-details a {
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.contact-details a:hover {
    text-decoration: underline;
}
    padding: 6px 10px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.view-link:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.action-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-links .view-link {
    margin: 0;
}

.footer {
    position: fixed;
    right: 18px;
    bottom: 14px;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 860px) {
    .auth-shell,
    .workspace {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .page {
        width: min(100% - 20px, 1120px);
        padding-top: 24px;
    }

    .brand-panel h1,
    .topbar h1 {
        font-size: 32px;
    }

    .topbar,
    .form-links {
        align-items: flex-start;
        flex-direction: column;
    }

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

/* Google Auth & Divider Styles */
.google-auth-wrapper {
    margin-bottom: 20px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
}

.btn-google:hover {
    background-color: #f8f9fa;
    border-color: #d2e3fc;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
    color: #1f1f1f;
}

.btn-google:active {
    background-color: #f1f3f4;
}

.btn-google .google-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--muted, #667085);
    font-size: 13px;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.auth-divider span {
    padding: 0 12px;
    letter-spacing: 0.02em;
}

