:root {
    --wt-blue: #4d4d4d;
    --wt-blue-dark: #1f1f1f;
    --wt-text: #222;
    --wt-muted: #555;
    --wt-border: #ddd;
    --wt-soft: #fafafa;
    --wt-white: #fff;
    --wt-radius: 2px;
    --wt-space: 24px;
}

/* BASE */

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    color: var(--wt-text);
    background: var(--wt-white);
    line-height: 1.5;
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

h2 {
    margin-top: 0;
}

.page-wrap {
    max-width: 1100px;
    margin: 0 auto 60px auto;
    padding: 0 20px;
}

/* HEADER */

.wt-header {
    border-bottom: 1px solid #e5e5e5;
    background: var(--wt-white);
    margin-bottom: 36px;
}

.wt-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.wt-logo img {
    max-height: 46px;
    display: block;
}

.wt-right {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 0.95rem;
}

.wt-right a,
.wt-lang a {
    color: var(--wt-text);
    text-decoration: none;
}

.wt-right a:hover,
.wt-lang a:hover,
.wt-lang a.active {
    color: var(--wt-blue);
}

.wt-credits {
    font-weight: 600;
    color: var(--wt-blue);
}

.wt-lang {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.9rem;
}

/* BLOCKS */

/* ACCORDIONS
   Applies to native details/summary accordions and the review accordion generated by validation_review_lib.php.
   Only the permanently visible accordion header is styled; the opened content keeps its existing layout. */

details {
    border: 1px solid var(--wt-border);
    border-radius: var(--wt-radius);
    margin-bottom: 14px;
    overflow: hidden;
    background: var(--wt-white);
}

details > summary,
.rv-accordion > summary {
    background: var(--wt-blue) !important;
    color: var(--wt-white) !important;
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 600;
    list-style: none;
    transition: background 0.2s ease;
    position: relative;
}

details > summary:hover,
.rv-accordion > summary:hover {
    background: var(--wt-blue-dark) !important;
    color: var(--wt-white) !important;
}

details > summary::-webkit-details-marker,
.rv-accordion > summary::-webkit-details-marker {
    display: none;
}

details > summary::after,
.rv-accordion > summary::after {
    content: "▾";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wt-white) !important;
    font-size: 14px;
}

details[open] > summary::after,
.rv-accordion[open] > summary::after {
    content: "▴";
}

details > *:not(summary) {
    background: var(--wt-white);
}



.card,
.box {
    border: 1px solid var(--wt-border);
    border-radius: var(--wt-radius);
    padding: var(--wt-space);
    background: var(--wt-soft);
    margin-bottom: 24px;
}

.card-white,
.content-block {
    background: var(--wt-white);
}

.content-block {
    border: 1px solid var(--wt-border);
    border-radius: var(--wt-radius);
    padding: var(--wt-space);
}

.auth-card {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.small,
.note {
    font-size: 0.9em;
    color: var(--wt-muted);
}

.error {
    background: #ffecec;
    border-left: 5px solid #c62828;
    padding: 12px;
    margin-bottom: 18px;
}

/* BUTTONS */

.button-loading {
    opacity: 0.75;
    pointer-events: none;
}

.button-loading::after {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.7);
    border-top-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: wt-spin 0.8s linear infinite;
}

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


button,
.button,
a.button {
    display: inline-block;
    padding: 11px 16px;
    background: var(--wt-blue);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    line-height: 20px;
    box-sizing: border-box;
}

button:hover,
.button:hover,
a.button:hover {
    background: var(--wt-blue-dark);
}

.button-disabled {
    display: inline-block;
    padding: 10px 14px;
    background: #ccc;
    color: #666;
    text-decoration: none;
    border-radius: 5px;
    cursor: not-allowed;
}

.full-width-button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.small-button {
    padding: 8px 11px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* FORMS */

.validator-form {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}

.validator-form.vertical {
    flex-direction: column;
    align-items: stretch;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    flex: 1 1 220px;
}

.validator-form.vertical .form-field {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
}

.form-field label {
    display: block;
    font-weight: bold;
}

.form-field select,
.form-field input[type="file"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="text"] {
    width: 100%;
    min-height: 42px;
    padding: 10px;
    font-size: 15px;
    line-height: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background: var(--wt-white);
}

.validator-form button {
    flex: 0 0 auto;
    min-height: 42px;
    margin-top: 0;
    white-space: nowrap;
}

.validator-form.vertical button {
    width: auto;
    align-self: flex-start;
}

/* TWO COLUMN AREA */

.two-column-blocks {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-top: 24px;
}

.two-column-item {
    flex: 1 1 0;
    min-width: 0;
}

.two-column-blocks .card,
.two-column-blocks .content-block {
    margin-bottom: 0;
}

/* TEMPLATE BUTTONS */

.two-buttons-row {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

.two-buttons-row a.button {
    flex: 1 1 0;
    display: block;
    text-align: center;
    box-sizing: border-box;
}

/* DASHBOARD */

.notice {
    border-left: 6px solid #f9a825;
    background: #fff8e1;
}

.success {
    border-left: 6px solid #2e7d32;
    background: #eef8ee;
}

.status-ready {
    color: #2e7d32;
    font-weight: bold;
}

.status-warning {
    color: #b26a00;
    font-weight: bold;
}

.status-not-ready {
    color: #c62828;
    font-weight: bold;
}

.account-status-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.account-status-block {
    flex: 1 1 0;
    border: 1px solid var(--wt-border);
    border-radius: var(--wt-radius);
    padding: 16px;
    background: var(--wt-white);
}

.account-status-block strong {
    display: block;
    margin-bottom: 6px;
}

.account-status-action {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.dashboard-table th,
.dashboard-table td {
    border-bottom: 1px solid var(--wt-border);
    padding: 12px 8px;
    text-align: left;
    vertical-align: middle;
}

.dashboard-table th {
    background: #f1f1f1;
}

.dashboard-table-compact th:nth-child(1),
.dashboard-table-compact td:nth-child(1) {
    width: 80px;
}

.dashboard-table-compact th:nth-child(2),
.dashboard-table-compact td:nth-child(2) {
    width: 40%;
}

.dashboard-table-compact th:nth-child(3),
.dashboard-table-compact td:nth-child(3) {
    width: 170px;
}

.dashboard-table-compact th:nth-child(4),
.dashboard-table-compact td:nth-child(4),
.dashboard-table-compact th:nth-child(5),
.dashboard-table-compact td:nth-child(5) {
    width: 130px;
    text-align: right;
}

.file-name-cell span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions a {
    margin-right: 8px;
}

/* MISC */

.steps {
    margin-top: 28px;
    padding-left: 20px;
}

code {
    background: #eee;
    padding: 2px 5px;
    border-radius: 4px;
}

/* RESPONSIVE */

@media (max-width: 850px) {
    .two-column-blocks,
    .account-status-row {
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .wt-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .wt-right {
        flex-wrap: wrap;
        gap: 12px;
    }

    .validator-form {
        flex-direction: column;
        align-items: stretch;
    }

    .form-field,
    .validator-form button {
        width: 100%;
        flex: 1 1 auto;
    }

    .two-buttons-row {
        flex-direction: column;
    }

    .two-buttons-row a.button {
        width: 100%;
    }

    .dashboard-table,
    .dashboard-table thead,
    .dashboard-table tbody,
    .dashboard-table th,
    .dashboard-table td,
    .dashboard-table tr {
        display: block;
    }

    .dashboard-table thead {
        display: none;
    }

    .dashboard-table tr {
        border: 1px solid var(--wt-border);
        border-radius: var(--wt-radius);
        padding: 12px;
        margin-bottom: 14px;
        background: var(--wt-white);
    }

    .dashboard-table td {
        border-bottom: none;
        padding: 6px 0;
        text-align: left !important;
    }

    .dashboard-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        color: var(--wt-muted);
        margin-bottom: 2px;
    }

    .file-name-cell span {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.footer-info {
    background: #fff;
}

.footer-info p:last-child {
    margin-bottom: 0;
}

.form-field textarea {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    line-height: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    background: var(--wt-white);
    font-family: Arial, Helvetica, sans-serif;
}

/* Disabled template/download buttons */
.two-buttons-row .button-disabled {
    flex: 1 1 0;
    display: block;
    text-align: center;
    box-sizing: border-box;
    padding: 11px 16px;
    min-height: 42px;
    line-height: 20px;
}

.form-field select option:disabled {
    color: #777;
}



/* JOURNAL LOOKUP / AUTOCOMPLETE
   Optional journal identification field used before DOCX upload.
   It must occupy a full form row because journal titles, ISSNs and source labels can be long. */

.journal-lookup-field {
    position: relative;
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
}

.validator-form .journal-lookup-field {
    flex-basis: 100%;
}

.journal-lookup-input {
    width: 100%;
}

.journal-lookup-results {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--wt-border);
    border-radius: 5px;
    box-shadow: 0 10px 28px rgba(0,0,0,.10);
    margin-top: 4px;
    box-sizing: border-box;
}

.journal-lookup-results,
.journal-lookup-results * {
    color: #000 !important;
}

.journal-lookup-option {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    background: #fff;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}

.journal-lookup-option:last-child {
    border-bottom: 0;
}

.journal-lookup-option:hover,
.journal-lookup-option:focus {
    background: #f5f5f5;
    outline: none;
}

.journal-lookup-title {
    font-weight: 700;
    display: block;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.journal-lookup-meta {
    color: #000 !important;
    font-size: .9em;
    display: block;
    margin-top: 4px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.journal-lookup-selected {
    border-color: #2e7d32 !important;
    background: #f4fbf5 !important;
}

.journal-lookup-selected-box {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #2e7d32;
    background: #f4fbf5;
    border-radius: 5px;
    color: #000;
}

.journal-lookup-selected-box * {
    color: #000 !important;
}

.journal-lookup-selected-title {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.journal-lookup-selected-meta {
    display: block;
    font-size: .9em;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.journal-lookup-selected-note {
    display: block;
    font-size: .9em;
    margin-bottom: 10px;
}

.journal-lookup-change {
    display: inline-block;
    padding: 7px 10px;
    font-size: .9rem;
    line-height: 1.2;
    background: #fff;
    color: #000 !important;
    border: 1px solid #999;
    border-radius: 5px;
    cursor: pointer;
}

.journal-lookup-change:hover,
.journal-lookup-change:focus {
    background: #f1f1f1;
}
