/* ─── Policy Acceptance Modal ────────────────────────────────────────── */
.policy-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100000;
  justify-content: center;
  align-items: center;
  padding: var(--space-sm);
}

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

.policy-modal {
  background: var(--color-surface);
  border-radius: var(--border-radius-md);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.policy-modal-header {
  background: var(--color-secondary);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.policy-modal-header h2 {
  color: var(--color-primary);
  font-size: var(--font-size-h4);
  margin: 0;
}

.policy-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--color-surface);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  padding: 6px 12px;
  min-height: var(--tap-target-min);
  transition: var(--transition-smooth);
}

.policy-close-btn:hover,
.policy-close-btn:focus {
  background: rgba(255, 255, 255, 0.25);
}

.policy-tabs-bar {
  display: flex;
  background: #F3F4F6;
  border-bottom: 2px solid var(--color-border);
  overflow-x: auto;
  flex-shrink: 0;
}

.policy-tab {
  flex: 1;
  min-width: 110px;
  min-height: var(--tap-target-min);
  padding: 14px var(--space-xs);
  font-family: var(--font-family-headings);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}

.policy-tab:hover {
  background: rgba(26, 26, 46, 0.03);
}

.policy-tab.active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-primary);
  background: var(--color-surface);
}

.policy-tick {
  display: inline-block;
  margin-left: var(--space-xs);
  color: var(--color-success);
  font-size: 15px;
  opacity: 0;
  transition: var(--transition-smooth);
}

.policy-tick.visible {
  opacity: 1;
}

.policy-panels-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.policy-panel {
  display: none;
  height: 100%;
  flex-direction: column;
  padding: var(--space-md);
  box-sizing: border-box;
}

.policy-panel.active {
  display: flex;
}

.policy-panel h3 {
  font-size: var(--font-size-h3);
  margin-bottom: 4px;
}

.policy-update-note {
  font-size: 13px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.policy-scroll-content {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: var(--space-sm);
  background: #FAFBFD;
  margin-bottom: var(--space-md);
  font-size: 14px;
  line-height: 1.7;
}

.policy-scroll-content h4 {
  font-size: 15px;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-xs);
  color: var(--color-secondary);
}

.policy-scroll-content ul {
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

.policy-scroll-content p {
  max-width: none;
  margin-bottom: var(--space-sm);
}

.policy-agree-footer {
  flex-shrink: 0;
}

.policy-modal-footer {
  padding: var(--space-sm) var(--space-md);
  background: #F9FAFB;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  text-align: center;
}

.policy-progress-text {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

#policy-submit-button {
  width: 100%;
}

#policy-submit-button:disabled {
  background: #D1D5DB;
  border-color: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
  transform: none;
}

/* ─── PDF / Document Viewer Modal ────────────────────────────────────── */
.pdf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100000;
  justify-content: center;
  align-items: center;
  padding: var(--space-sm);
}

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

.pdf-modal {
  background: var(--color-secondary);
  border-radius: var(--border-radius-md);
  width: 100%;
  max-width: 860px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.pdf-modal-title {
  color: var(--color-surface);
  font-size: var(--font-size-h4);
  margin: 0;
}

.pdf-modal-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--color-surface);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  padding: 6px 14px;
  min-height: var(--tap-target-min);
  transition: var(--transition-smooth);
}

.pdf-modal-close:hover,
.pdf-modal-close:focus {
  background: rgba(255,255,255,0.2);
}

.pdf-frame-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Blocks context menu and drag-to-save on the iframe */
.pdf-frame-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
