/**
 * Academic Publication House – Forms, modals, discount pop-up
 * Brand accent: #e1306c. Dark header, professional typography.
 */

:root {
  --aph-accent: #e1306c;
  --aph-accent-hover: #c6285a;
  --aph-accent-light: rgba(225, 48, 108, 0.12);
  --aph-dark: #1a1a2e;
  --aph-dark-header: #16213e;
  --aph-form-border: rgba(0, 0, 0, 0.1);
  --aph-form-focus: rgba(225, 48, 108, 0.25);
}

/* Dark header – brand */
#header {
  background: var(--aph-dark) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}
#header .logo a { color: #fff; }
#header .navbar .nav-link { color: rgba(255, 255, 255, 0.88); }
#header .navbar .nav-link:hover { color: #fff; }
#header .navbar .dropdown > a { color: rgba(255, 255, 255, 0.88); }
#header .navbar .dropdown > a:hover { color: #fff; }
#header .navbar .dropdown ul { background: #16213e; border-color: rgba(255,255,255,0.08); }
#header .navbar .dropdown ul a { color: rgba(255,255,255,0.9); }
#header .navbar .dropdown ul a:hover { background: rgba(255,255,255,0.08); color: #fff; }
#header .mobile-nav-toggle { color: #fff; }
#header .appointment-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
}
#header .appointment-btn:hover {
  background: #2a3654;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

/* ----- Header CTAs ----- */
.aph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.aph-btn-accent {
  background: var(--aph-accent);
  color: #fff;
}

.aph-btn-accent:hover {
  background: var(--aph-accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(225, 48, 108, 0.4);
}

.aph-discount-cta {
  font-size: 12px;
  font-weight: 600;
  color: var(--aph-accent);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.aph-discount-cta:hover {
  color: var(--aph-accent-hover);
  background: var(--aph-accent-light);
}

@media (max-width: 768px) {
  .menu-btn-fixed.gap-2 {
    gap: 6px !important;
  }
  .aph-btn, .appointment-btn {
    padding: 6px 14px;
    font-size: 12px;
  }
  .aph-discount-cta {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* ----- Manuscript modal ----- */
.aph-modal-content {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.aph-modal-header {
  background: var(--aph-dark);
  color: #fff;
  padding: 1rem 1.5rem;
  border-bottom: none;
}

.aph-modal-header .modal-title {
  font-weight: 700;
  font-size: 1.15rem;
}

.aph-modal-body {
  padding: 1.5rem;
  background: #fff;
}

.aph-modal-intro {
  margin-bottom: 1.25rem;
  color: #444;
  font-size: 0.95rem;
}

.aph-modal-intro strong {
  color: var(--aph-accent);
}

.aph-form .form-label {
  font-weight: 500;
  color: #333;
  margin-bottom: 0.35rem;
}

.aph-input {
  border: 1px solid var(--aph-form-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.aph-input:focus {
  border-color: var(--aph-accent);
  box-shadow: 0 0 0 3px var(--aph-form-focus);
  outline: none;
}

.aph-input::placeholder {
  color: #999;
}

.aph-file-input {
  padding: 8px 12px;
}

.aph-form-actions {
  padding-top: 0.5rem;
}

.aph-btn-submit {
  padding: 12px 28px;
  font-size: 15px;
  min-width: 140px;
}

.aph-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.aph-form-message {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

.aph-form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.aph-form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ----- Discount pop-up ----- */
.aph-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.aph-popup.is-visible {
  opacity: 1;
  visibility: visible;
}

.aph-popup.is-visible .aph-popup-backdrop {
  opacity: 1;
}

.aph-popup.is-visible .aph-popup-card {
  opacity: 1;
  transform: translateY(0);
}

.aph-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.aph-popup-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  padding: 1.75rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.aph-popup.is-visible .aph-popup-card {
  opacity: 1;
  transform: translateY(0);
}

.aph-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.aph-popup-close:hover {
  background: #f0f0f0;
  color: #333;
}

.aph-popup-body {
  padding-right: 8px;
}

.aph-popup-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--aph-dark);
  margin-bottom: 0.5rem;
  padding-right: 2rem;
  line-height: 1.3;
}

.aph-popup-desc {
  color: #555;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.aph-form-compact .aph-input {
  padding: 10px 12px;
}

/* ----- Accessibility ----- */
.aph-popup[aria-hidden="true"] {
  pointer-events: none;
}

.aph-popup[aria-hidden="false"] {
  pointer-events: auto;
}

/* ----- Mobile ----- */
@media (max-width: 576px) {
  .aph-popup-card {
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.25rem;
  }
  .aph-popup-title {
    font-size: 1.15rem;
    padding-right: 1.5rem;
  }
  #manuscript-modal .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }
  #manuscript-modal .modal-body {
    padding: 1rem;
  }
}
