/* ─── CPS Public Form Styles — Fully Responsive ──────────────── */

*, *::before, *::after { box-sizing: border-box; }

/* ── Elementor / Hello Elementor defensive resets ──────────────
   Scoped to .cps-form-wrap so nothing outside the plugin is affected.
   ────────────────────────────────────────────────────────────── */

/* Remove widget-container padding so the plugin controls its own spacing */
.elementor-widget-container:has(.cps-form-wrap),
.elementor-widget-shortcode:has(.cps-form-wrap) { padding: 0 !important; }

/* Headings — Elementor & Hello Elementor set global margin / colour / font-size */
.cps-form-wrap h1, .cps-form-wrap h2, .cps-form-wrap h3,
.cps-form-wrap h4, .cps-form-wrap h5, .cps-form-wrap h6 {
    font-family: inherit !important;
    font-weight: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* Paragraphs — Elementor adds margin-bottom to all p tags */
.cps-form-wrap p { margin: 0 !important; padding: 0 !important; }

/* Links — Hello Elementor colours anchors with the theme accent */
.cps-form-wrap a,
.cps-form-wrap a:link,
.cps-form-wrap a:visited,
.cps-form-wrap a:hover,
.cps-form-wrap a:focus { color: inherit !important; text-decoration: none !important; }

/* Buttons — theme/Elementor presets add border-radius, background, padding */
.cps-form-wrap button,
.cps-form-wrap button:focus,
.cps-form-wrap button:hover {
    font-family: inherit !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Inputs / selects / textareas — prevent system chrome from overriding styles */
.cps-form-wrap input,
.cps-form-wrap textarea,
.cps-form-wrap select {
    font-family: inherit !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

/* Labels */
.cps-form-wrap label { font-family: inherit !important; }

/* ── End Elementor resets ─────────────────────────────────────── */

.cps-form-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 48px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    -webkit-text-size-adjust: 100%;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.cps-hero {
    text-align: center;
    padding: 40px 24px 32px;
    background: linear-gradient(135deg, #1a3c6e 0%, #0d2347 100%);
    border-radius: 14px;
    margin-bottom: 20px;
    color: #fff;
}
.cps-hero-icon { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 10px; }
.cps-hero h1  { margin: 0; font-size: clamp(1.2rem, 4vw, 1.7rem); font-weight: 700; color: #fff; line-height: 1.25; }
.cps-hero-sub { margin: 6px 0 0; opacity: .85; font-size: clamp(.85rem, 2.5vw, 1rem); }
.cps-hero-dates { margin: 8px 0 0; opacity: .7; font-size: .875rem; }

/* ── Welcome ──────────────────────────────────────────────────── */
.cps-welcome {
    background: #f0f4ff;
    border-left: 4px solid #1a3c6e;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: .9rem;
    line-height: 1.6;
}

/* ── Deadline banner ──────────────────────────────────────────── */
.cps-deadline-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: .875rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
    line-height: 1.5;
}
.cps-deadline-open   { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.cps-deadline-closed { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.cps-countdown-wrap  { font-size: .88rem; opacity: .9; }

/* ── Closed state ─────────────────────────────────────────────── */
.cps-closed-msg { text-align: center; padding: 48px 20px; color: #666; }
.cps-closed-icon { font-size: 3rem; margin-bottom: 16px; }
.cps-closed-msg h2 { color: #1a1a1a; }

/* ── Progress bar ─────────────────────────────────────────────── */
.cps-progress-bar {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 4px;
}
.cps-progress-step {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-direction: column;
    font-size: .75rem;
    color: #bbb;
    font-weight: 500;
    white-space: nowrap;
}
.cps-progress-step.active { color: #1a3c6e; }
.cps-progress-step.done   { color: #059669; }
.cps-step-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #e5e7eb; color: #888;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 700;
    border: 2px solid #e5e7eb;
    transition: all .2s;
    flex-shrink: 0;
}
.cps-progress-step.active .cps-step-dot { background: #1a3c6e; color: #fff; border-color: #1a3c6e; }
.cps-progress-step.done   .cps-step-dot { background: #059669; color: #fff; border-color: #059669; }
.cps-progress-line { flex: 1; height: 2px; background: #e5e7eb; margin: 0 4px; margin-bottom: 20px; min-width: 12px; }

/* ── Section cards ────────────────────────────────────────────── */
.cps-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.cps-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a3c6e;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.cps-section-icon { font-size: 1.1rem; }

/* ── Form fields ──────────────────────────────────────────────── */
.cps-field { margin-bottom: 18px; }
.cps-field label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.cps-req { color: #dc2626; }
.cps-field input[type="text"],
.cps-field input[type="email"],
.cps-field input[type="tel"],
.cps-field input[type="number"],
.cps-field textarea,
.cps-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;   /* ≥16px prevents iOS zoom */
    color: #111;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.cps-field input:focus,
.cps-field textarea:focus,
.cps-field select:focus {
    outline: none;
    border-color: #1a3c6e;
    box-shadow: 0 0 0 3px rgba(26,60,110,.1);
}
.cps-field input.cps-input-error,
.cps-field textarea.cps-input-error,
.cps-field select.cps-input-error { border-color: #dc2626 !important; }
.cps-field textarea { resize: vertical; min-height: 120px; }
.cps-char-count { font-size: .75rem; color: #9ca3af; margin-top: 4px; text-align: right; }
.cps-char-count.cps-count-ok   { color: #16a34a; }
.cps-char-count.cps-count-warn { color: #d97706; }

.cps-field-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* ── Errors ───────────────────────────────────────────────────── */
.cps-err { color: #dc2626; font-size: .8rem; margin-top: 5px; display: none; }
.cps-err.visible { display: block; }
.cps-form-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px 16px;
    color: #991b1b;
    font-size: .875rem;
    margin-bottom: 16px;
}

/* ── Success box ──────────────────────────────────────────────── */
.cps-success-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: clamp(24px, 6vw, 48px) clamp(16px, 5vw, 32px);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.cps-success-icon { font-size: clamp(2.5rem, 8vw, 3.5rem); margin-bottom: 16px; }
.cps-success-box h2 { color: #1a3c6e; margin: 0 0 8px; font-size: clamp(1.1rem, 4vw, 1.4rem); }
.cps-ref-box {
    display: inline-block;
    background: #f0f4ff;
    border: 1px solid #c7d7f7;
    border-radius: 8px;
    padding: 10px 20px;
    margin: 14px 0;
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    font-weight: 700;
    color: #1a3c6e;
    letter-spacing: .04em;
    word-break: break-all;
}
.cps-success-note { color: #666; font-size: .875rem; line-height: 1.6; max-width: 460px; margin: 0 auto; }

/* ── Author cards ─────────────────────────────────────────────── */
.cps-author-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 14px;
    background: #fafafa;
    position: relative;
}
.cps-author-card.is-corresponding { border-color: #1a3c6e; background: #f0f4ff; }
.cps-author-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cps-author-number {
    width: 28px; height: 28px; border-radius: 50%;
    background: #1a3c6e; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.cps-author-title { font-weight: 600; font-size: .9rem; flex: 1; }
.cps-corresponding-badge {
    background: #1a3c6e; color: #fff;
    padding: 2px 10px; border-radius: 12px;
    font-size: .75rem; font-weight: 600;
}
.cps-author-remove {
    background: none; border: none; color: #dc2626;
    cursor: pointer; font-size: 1.2rem; padding: 4px; line-height: 1;
    min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center;
}
.cps-author-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cps-author-fields .cps-field { margin: 0; }
.cps-corresponding-toggle {
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .85rem;
    cursor: pointer;
    line-height: 1.5;
}
.cps-corresponding-toggle input { width: auto; margin-top: 2px; flex-shrink: 0; }

.cps-btn-add-author {
    background: none;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    width: 100%;
    padding: 14px;
    cursor: pointer;
    color: #6b7280;
    font-size: .9rem;
    font-weight: 600;
    transition: all .15s;
    font-family: inherit;
    min-height: 48px;
}
.cps-btn-add-author:hover { border-color: #1a3c6e; color: #1a3c6e; background: #f0f4ff; }

/* ── File upload ──────────────────────────────────────────────── */
.cps-file-drop {
    position: relative;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    background: #fafafa;
    overflow: hidden;
}
.cps-file-drop:hover { border-color: #1a3c6e; background: #f0f4ff; }
.cps-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
}
.cps-file-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.cps-file-drop-label p { margin: 4px 0; font-size: .875rem; color: #555; }
.cps-file-hint { font-size: .78rem !important; color: #9ca3af !important; }
.cps-file-chosen {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .875rem;
    flex-wrap: wrap;
}
.cps-file-chosen-icon { font-size: 1.5rem; }
.cps-file-chosen-name { font-weight: 600; color: #1a3c6e; word-break: break-all; }
.cps-file-chosen-change { margin-left: auto; font-size: .78rem; color: #6b7280; cursor: pointer; text-decoration: underline; min-width: 44px; text-align: right; }

/* ── Declaration ──────────────────────────────────────────────── */
.cps-declaration-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px 20px;
}
.cps-declaration-box ul { margin: 0 0 14px; padding-left: 20px; font-size: .875rem; line-height: 1.8; color: #555; }
.cps-checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .875rem; font-weight: 600; }
.cps-checkbox-label input { width: auto; margin-top: 3px; flex-shrink: 0; }

/* ── Navigation buttons ───────────────────────────────────────── */
.cps-step-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; flex-wrap: wrap; }
.cps-btn-next, .cps-btn-prev, .cps-btn-submit {
    padding: 13px 28px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all .15s;
    min-height: 48px;
}
.cps-btn-next   { background: #1a3c6e; color: #fff; }
.cps-btn-next:hover { background: #0d2347; }
.cps-btn-prev   { background: #fff; color: #555; border: 1.5px solid #d1d5db; }
.cps-btn-prev:hover { background: #f3f4f6; }
.cps-btn-submit { background: linear-gradient(135deg, #059669, #047857); color: #fff; padding: 14px 36px; font-size: 1rem; }
.cps-btn-submit:hover { background: linear-gradient(135deg, #047857, #065f46); }
.cps-btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Spinner / overlay ────────────────────────────────────────── */
.cps-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.cps-overlay-box {
    background: #fff;
    border-radius: 14px;
    padding: clamp(24px, 6vw, 40px) clamp(20px, 6vw, 48px);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    width: 100%;
    max-width: 340px;
}
.cps-spinner {
    width: 44px; height: 44px;
    border: 4px solid #e5e7eb;
    border-top-color: #1a3c6e;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: cps-spin 0.8s linear infinite;
}
@keyframes cps-spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════════
   REVIEWER COMMITTEE
════════════════════════════════════════════════════════════════ */

.cps-committee-wrap { max-width: 960px; }

.cps-committee-empty {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    font-size: .95rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

.cps-committee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.cps-committee-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 28px 22px 22px;
    text-align: center;
    transition: box-shadow .2s, transform .2s;
}
.cps-committee-card:hover {
    box-shadow: 0 6px 24px rgba(26,60,110,.12);
    transform: translateY(-2px);
}

/* Avatar */
.cps-committee-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 16px;
    border: 3px solid #e5e7eb;
    flex-shrink: 0;
}
.cps-committee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cps-committee-initials {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a3c6e, #0d2347);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Info */
.cps-committee-info { text-align: center; }

.cps-committee-name {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 0 4px !important;
    line-height: 1.3 !important;
}

.cps-committee-institution {
    font-size: .825rem !important;
    color: #6b7280 !important;
    margin: 0 0 12px !important;
    line-height: 1.4 !important;
}

/* Tags */
.cps-committee-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}
.cps-committee-tag {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    padding: 3px 10px;
    white-space: nowrap;
}

/* Bio */
.cps-committee-bio {
    font-size: .825rem !important;
    color: #374151 !important;
    line-height: 1.55 !important;
    margin: 0 0 12px !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Profile link */
.cps-committee-link {
    display: inline-block;
    font-size: .8rem !important;
    font-weight: 600 !important;
    color: #1a3c6e !important;
    text-decoration: none !important;
    border-bottom: 1.5px solid #1a3c6e;
    padding-bottom: 1px;
    transition: opacity .15s;
}
.cps-committee-link:hover { opacity: .7; }

/* ════════════════════════════════════════════════════════════════
   BREAKPOINTS
════════════════════════════════════════════════════════════════ */

/* Tablet — 768px */
@media (max-width: 768px) {
    .cps-form-wrap { padding: 0 12px 36px; }
    .cps-hero { padding: 28px 18px 22px; border-radius: 10px; }
    .cps-section { padding: 20px 18px; }
    .cps-field-row { grid-template-columns: 1fr 1fr; }
    .cps-success-box { padding: 28px 18px; }
    .cps-step-nav { flex-direction: column-reverse; }
    .cps-btn-next, .cps-btn-prev, .cps-btn-submit { width: 100%; text-align: center; }
    .cps-committee-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* Mobile — 480px */
@media (max-width: 480px) {
    .cps-form-wrap { padding: 0 10px 28px; }
    .cps-hero { padding: 22px 14px 18px; border-radius: 8px; margin-bottom: 14px; }
    .cps-section { padding: 16px 14px; border-radius: 8px; }
    .cps-field-row { grid-template-columns: 1fr; }
    .cps-author-fields { grid-template-columns: 1fr; }
    .cps-progress-step span { display: none; } /* hide labels, keep dots */
    .cps-progress-step.active span,
    .cps-progress-step.done span { display: none; }
    .cps-declaration-box { padding: 14px 14px; }
    .cps-file-drop { padding: 20px 12px; }
    .cps-section-title { font-size: .9rem; }
    .cps-deadline-banner { font-size: .8rem; }
    .cps-countdown-wrap { display: block; width: 100%; margin-top: 4px; }
}

/* Very small — 360px */
@media (max-width: 360px) {
    .cps-step-dot { width: 26px; height: 26px; font-size: .75rem; }
    .cps-progress-line { min-width: 8px; }
    .cps-btn-next, .cps-btn-prev, .cps-btn-submit { padding: 12px 16px; font-size: .875rem; }
}
