/* ==========================================================================
   Adobe document flow — single stylesheet
   Views: preparing / download / complete / denied
   ========================================================================== */

/* ---------- Reset and base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #fff;
  font-family: 'Poppins', sans-serif;
}

/* ---------- View switching ---------- */
.view {
  display: none;
  min-height: 100vh;
}

.view.active {
  display: block;
}

/* ==========================================================================
   Preparing view (original index.html)
   ========================================================================== */
.view[data-view="preparing"] .container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  gap: 15px;
  padding-bottom: 20vh;
}

.view[data-view="preparing"] .logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.view[data-view="preparing"] .download-text {
  font-weight: bold;
  font-size: 16px;
}

.view[data-view="preparing"] .spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #ED2224;
  border-top-color: transparent;
  border-radius: 50%;
  animation: demo-spin 0.7s linear infinite;
}

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

/* ==========================================================================
   Shared modal (download + denied)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 15px;
  box-sizing: border-box;
}

.modal-content {
  background-color: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: demo-modal-in 0.3s ease-out;
  text-align: center;
}

@keyframes demo-modal-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header h2 {
  font-size: 1.5rem;
  margin: 0 0 10px;
  color: #333;
}

/* Headings receive focus programmatically when a view opens; keep that
   accessible without showing the browser's focus ring on the modal. */
[tabindex="-1"]:focus {
  outline: none;
}

.modal-text {
  font-size: 1rem;
  line-height: 1.5;
  color: #555;
  margin-bottom: 10px;
}

.modal-subtext {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #666;
  padding-top: 10px;
  margin: 0;
}

/* ==========================================================================
   Download view (original download.html)
   ========================================================================== */
.view[data-view="download"] {
  position: relative;
  min-height: 100vh;
  background-color: #fff;
  background-image: url('assets/images/acrobat-background.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  font-family: Arial, sans-serif;
}

.view[data-view="download"] .modal-content {
  padding: 30px;
  width: 90%;
}

.view[data-view="download"] .modal-header img {
  width: 100px;
  margin-bottom: 15px;
}

.continue-btn {
  background-color: #ED2224;
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
  width: 100%;
  max-width: 250px;
  transition: background-color 0.3s;
}

.continue-btn:hover {
  background-color: #c71b1d;
}

.continue-btn.is-hidden {
  display: none;
}

/* Loading state inside the download modal */
.view[data-view="download"] .spinner {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.view[data-view="download"] .spinner.is-visible {
  display: flex;
}

.view[data-view="download"] .spinner::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 4px solid #ED2224;
  border-top-color: transparent;
  border-radius: 50%;
  animation: demo-spin 0.7s linear infinite;
}

.view[data-view="download"] .spinner p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.info-text {
  color: #666;
  font-size: 12px;
  margin-top: 10px;
}

/* ==========================================================================
   Complete view (original complete.php + download.php)
   ========================================================================== */
.view[data-view="complete"] {
  background-color: #f5f5f5;
  font-family: Arial, sans-serif;
}

.view[data-view="complete"] .container {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 15vh 10px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.view[data-view="complete"] .container img {
  width: 150px;
  margin-bottom: 20px;
}

.view[data-view="complete"] .container p {
  line-height: 1.6;
  margin: 0;
  padding: 0 10px;
}

.view[data-view="complete"] .container a {
  color: #d32f2f;
  text-decoration: none;
  font-weight: bold;
}

.view[data-view="complete"] .container a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Denied view (original denied.html)
   ========================================================================== */
.view[data-view="denied"] {
  min-height: 100vh;
  background-image: url('assets/images/denied-background.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;
  font-family: Arial, sans-serif;
}

.view[data-view="denied"] .modal-content {
  padding: 20px;
}

.view[data-view="denied"] .modal-header {
  margin-bottom: 15px;
}

.alert-icon {
  font-size: 3rem;
  color: #ED2224;
  margin-bottom: 15px;
  line-height: 1;
}

/* ---------- Responsive adjustments (denied modal) ---------- */
@media (max-width: 480px) {
  .view[data-view="denied"] .modal-content {
    padding: 15px;
  }

  .alert-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  .modal-text,
  .modal-subtext {
    font-size: 0.9rem;
  }
}

@media (max-width: 360px) {
  .view[data-view="denied"] .modal-content {
    padding: 12px;
  }

  .modal-header h2 {
    font-size: 1.2rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .view[data-view="preparing"] .spinner,
  .view[data-view="download"] .spinner::before,
  .modal-content {
    animation: none;
  }
}
