/* ==========================================================================
   JIPP — Journal of Ideas, Policies and Practices
   Official Academic Journal Style (SHD Research Foundation)
   Submission Portal Stylesheet (submit.jipp.in)
   ========================================================================== */

: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;
  --border-focus: #0d233a;
  --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: 1100px;
  --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);
  --shadow-lg: 0 10px 25px rgba(13, 35, 58, 0.12);
  --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-color: var(--bg-page);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Top Notice Bar (jipp.in)
   ========================================================================== */
.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.1);
}

.top-notice-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-notice-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-badge {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-notice-right {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

.top-notice-right a {
  color: #cbd5e1;
  text-decoration: none;
  transition: var(--transition);
}

.top-notice-right a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ==========================================================================
   Header & Navigation (jipp.in)
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--primary);
}

.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
}

.nav-item a {
  display: block;
  padding: 8px 12px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-item a:hover,
.nav-item.active a {
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-submit-nav {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm) !important;
  margin-left: 8px;
  font-size: 0.86rem !important;
  transition: var(--transition);
}

.btn-submit-nav:hover {
  background: var(--accent) !important;
  color: #fff !important;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
}

/* ==========================================================================
   Page Banner & Hero Intro
   ========================================================================== */
.portal-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  padding: 44px 0 52px;
  border-bottom: 3px solid var(--accent);
}

.hero-badge {
  display: inline-block;
  background: rgba(180, 122, 31, 0.25);
  border: 1px solid var(--accent-light);
  color: var(--accent-light);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 820px;
  line-height: 1.6;
}

/* ==========================================================================
   Main Form Content Wrapper
   ========================================================================== */
.form-wrapper {
  max-width: var(--container-max);
  margin: -24px auto 60px auto;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

/* Banner for Draft Status */
.draft-alert {
  background: #ffffff;
  border-left: 4px solid var(--accent);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.draft-alert button {
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: 0.88rem;
}

/* Section Cards (Academic style matching jipp.in) */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 36px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.form-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
}

.badge-step {
  background: var(--primary);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  line-height: 1.55;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px 24px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}

.req-star {
  color: var(--danger);
  font-weight: bold;
}

/* Inputs, Selects & Textareas */
.form-control,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 35, 58, 0.1);
}

.form-control::placeholder,
.form-textarea::placeholder {
  color: var(--text-light);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

/* Counters */
.char-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.char-counter.error {
  color: var(--danger);
  font-weight: 700;
}

/* Keywords Tags */
.keyword-input-wrapper {
  display: flex;
  gap: 10px;
}

.keyword-input-wrapper input {
  flex: 1;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn-secondary:hover {
  background: var(--bg-page);
  border-color: var(--primary);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-badge {
  background: var(--accent-soft);
  border: 1px solid var(--accent-light);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  padding: 0;
}

.tag-remove:hover {
  color: var(--danger);
}

/* Section 2: Co-authors Table (jipp.in table style) */
.coauthors-table-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 16px;
}

.coauthors-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.coauthors-table th {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 14px;
  white-space: nowrap;
  font-size: 0.82rem;
}

.coauthors-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.coauthors-table tr:last-child td {
  border-bottom: none;
}

.coauthors-table tr:hover td {
  background-color: var(--bg-page);
}

.table-empty-row td {
  text-align: center;
  padding: 32px 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-style: italic;
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  transition: var(--transition);
}

.btn-icon-danger:hover {
  color: var(--danger);
}

.subtext-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 10px;
}

/* File Upload Boxes */
.file-upload-row {
  margin-bottom: 20px;
}

.file-input-custom {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  transition: var(--transition);
}

.file-input-custom:hover {
  border-color: #cbd5e1;
}

.file-input-custom input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-input-btn {
  background: var(--bg-page);
  border: 1px solid var(--border);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  font-family: var(--font-sans);
}

.file-input-name {
  font-size: 0.88rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-input-name.has-file {
  color: var(--primary);
  font-weight: 600;
}

.file-badge-word {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-left: auto;
  margin-right: 6px;
  text-transform: uppercase;
  border: 1px solid var(--accent-light);
}

/* ==========================================================================
   Section 5: APC Discount Styling (jipp.in style)
   ========================================================================== */
.apc-item {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.apc-item:last-of-type {
  border-bottom: none;
  margin-bottom: 10px;
  padding-bottom: 0;
}

.apc-question-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.apc-question-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.radio-group-inline {
  display: flex;
  gap: 22px;
  margin: 10px 0 14px 0;
  flex-wrap: wrap;
}

.radio-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.radio-pill-label input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.apc-conditional-input {
  margin-top: 10px;
  padding-left: 2px;
}

.notice-box-apc {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--text-main);
  margin-top: 24px;
  line-height: 1.6;
}

.notice-box-apc strong {
  color: var(--primary);
}

.notice-box-apc a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
}

/* ==========================================================================
   Section 6: Declarations Styling
   ========================================================================== */
.declaration-item {
  margin-bottom: 20px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-text {
  flex: 1;
}

.checkbox-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.checkbox-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.nested-input-field {
  margin-top: 10px;
  margin-left: 30px;
}

/* Action Footer */
.actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-bottom: 50px;
}

.btn-draft {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-draft:hover {
  background: var(--bg-page);
  border-color: #cbd5e1;
}

.btn-submit {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 13px 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  box-shadow: 0 2px 6px rgba(180, 122, 31, 0.25);
}

.btn-submit:hover {
  background: var(--accent-light);
  color: #000000;
  border-color: var(--accent-light);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Modal Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 21, 36, 0.65);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-md);
  max-width: 580px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  border-top: 4px solid var(--accent);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Success Modal */
.success-icon-badge {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px auto;
  font-weight: bold;
}

.tracking-badge-box {
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin: 20px 0;
}

.tracking-code {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  font-family: monospace;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Site Footer (Exact match to jipp.in)
   ========================================================================== */
.site-footer {
  background: var(--primary-dark);
  color: #cbd5e1;
  padding: 56px 0 24px;
  border-top: 4px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer-brand h4 {
  font-family: var(--font-serif);
  color: #ffffff;
  font-size: 1.2rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 14px;
  color: #94a3b8;
}

.footer-col h5 {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 4px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 9px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #64748b;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-lg);
  }
  .nav-menu.active {
    display: flex;
  }
  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-card {
    padding: 22px 18px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .actions-footer {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .btn-draft, .btn-submit {
    width: 100%;
    justify-content: center;
  }

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