/* ==========================================================================
   JIPP — Reviewer Review Portal
   Matches the official journal style used by the JIPP reviewer portals.
   ========================================================================== */

:root {
  --primary: #0d233a;
  --primary-light: #183b5e;
  --primary-dark: #071524;
  --accent: #b47a1f;
  --accent-light: #e6a847;
  --accent-soft: #fbf5eb;
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-light: #9ca3af;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #15803d;
  --danger: #b91c1c;

  --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --container-max: 1180px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(13, 35, 58, 0.08);
  --transition: all 0.2s ease-in-out;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-page);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 10px; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Notice bar */
.top-notice-bar {
  background: var(--primary-dark);
  color: #f1f5f9;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-notice-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.top-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.mode-badge {
  margin-left: auto;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fdba74;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}
.brand-titles {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.header-publisher {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Main layout */
.page-section { flex: 1; }
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 40px;
  align-items: start;
  padding: 48px 0 64px;
}

/* Intro sidebar */
.intro {
  padding-top: 8px;
  position: sticky;
  top: 20px;
}
.section-subtitle {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}
.intro h1 {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1.25;
  color: var(--primary);
  margin-bottom: 14px;
}
.intro p {
  color: var(--text-muted);
  font-size: 1rem;
}
.intro-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.87rem;
  color: #6b531f;
}
.intro-note-icon {
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.3;
}
.privacy-note {
  background: #eef2f7;
  border-left-color: var(--primary-light);
  color: var(--text-muted);
}
.privacy-note .intro-note-icon { color: var(--primary-light); }

/* Form card */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}

.form-section {
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 12px;
  padding-bottom: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}
.section-heading h2 {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--primary);
  line-height: 1.3;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
}
.field label,
.field legend,
.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  padding: 0;
  display: block;
}
.required { color: var(--accent); }

.field input[type="text"],
.field input[type="email"],
.field textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}
.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-light); }
.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 35, 58, 0.1);
}
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.field input[aria-invalid="true"]:focus,
.field textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}
.field-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.field-error {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Radio groups */
.radio-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.radio-options.stacked { grid-template-columns: 1fr; }
.radio-option {
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: var(--transition);
}
.radio-option:hover {
  border-color: #cbd5e1;
  background: #fcfdfe;
}
.radio-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.radio-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.4;
}
.radio-body::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1.5px solid #94a3b8;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
}
.radio-option:has(input:checked),
.radio-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.radio-option:has(input:checked) .radio-body::before,
.radio-option.is-selected .radio-body::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px #fff;
}
.radio-option input:focus-visible + .radio-body {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}
.radio-options.has-error .radio-option { border-color: var(--danger); }

/* Checkbox */
.check-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.55;
  transition: var(--transition);
}
.check-option:hover { background: #fcfdfe; border-color: #cbd5e1; }
.check-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 2px;
  border: 1.5px solid #94a3b8;
  border-radius: var(--radius-sm);
  background: #fff;
  color: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  transition: var(--transition);
}
.check-option input:checked + .check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.check-option input:focus-visible + .check-box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.check-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.check-option.has-error { border-color: var(--danger); }

/* Guidance block */
.guidance {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 18px;
}
.guidance-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.guidance ul {
  margin: 0;
  padding-left: 18px;
}
.guidance li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 5px;
}
.guidance li:last-child { margin-bottom: 0; }

/* File upload */
.file-drop {
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  background: #fafcfe;
  padding: 18px;
  text-align: center;
  transition: var(--transition);
}
.file-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop.has-error { border-color: var(--danger); }
.file-drop input[type="file"] {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-main);
}
.file-drop input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.file-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Buttons */
.submit-area {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-submit:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-light);
}
.btn-submit:focus-visible {
  outline: 3px solid rgba(180, 122, 31, 0.45);
  outline-offset: 2px;
}
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.form-status {
  font-size: 0.87rem;
  color: var(--danger);
  font-weight: 500;
}
.form-footnote {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Confirmation */
.confirmation-panel {
  text-align: center;
  padding: 12px 4px 8px;
}
.confirmation-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #e7f5ec;
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}
.confirmation-panel h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.confirmation-panel > p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 420px;
  margin: 0 auto;
}
.summary-list {
  margin: 24px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: left;
}
.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.summary-list > div:last-child { border-bottom: none; }
.summary-list dt {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.summary-list dd {
  color: var(--primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.summary-list dd a {
  color: var(--primary-light);
  text-decoration: underline;
}
.confirmation-note {
  margin-top: 18px !important;
  padding: 12px 16px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: var(--radius-sm);
  color: #9a3412 !important;
  font-size: 0.85rem !important;
}

/* Footer */
.site-footer {
  background: var(--primary-dark);
  color: #94a3b8;
  padding: 20px 0;
  border-top: 3px solid var(--accent);
  font-size: 0.82rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 900px) {
  .form-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 48px;
  }
  .intro { position: static; }
  .intro h1 { font-size: 1.8rem; }
  .intro p { max-width: none; }
  .header-publisher { display: none; }
}
@media (max-width: 600px) {
  .form-card { padding: 22px 18px; border-radius: var(--radius-md); }
  .intro h1 { font-size: 1.6rem; }
  .radio-options { grid-template-columns: 1fr; }
  .btn-submit { width: 100%; }
  .submit-area { align-items: stretch; }
  .summary-list > div { flex-direction: column; gap: 2px; }
  .summary-list dd { text-align: left; }
  .footer-inner { flex-direction: column; text-align: center; }
}
