@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #ccfbf1;
  --bg-gradient-from: #0f172a;
  --bg-gradient-to: #1e293b;
  --card-bg: rgba(255, 255, 255, 0.96);
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #991b1b;
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --radius-lg: 1rem;
  --radius-md: 0.75rem;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-from) 0%, var(--bg-gradient-to) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
}

.viewer-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.card-challenge {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: fadeIn 0.4s ease-out;
}

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

.card-header {
  background: linear-gradient(135deg, #0d9488 0%, #047857 100%);
  color: #ffffff;
  padding: 2rem 1.5rem;
  text-align: center;
}

.card-header .logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: #ffffff;
  border-radius: 50%;
  margin-bottom: 0.75rem;
  padding: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header .logo-badge img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-header .logo-badge svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #0d9488;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-header p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.card-body {
  padding: 2rem 1.5rem;
}

.alert-error {
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-error svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: var(--error-text);
  fill: none;
  stroke-width: 2;
}

.doc-info-badge {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-info-badge strong {
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.captcha-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.captcha-img-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  line-height: 0;
  display: flex;
  align-items: center;
  background: #f8fafc;
}

.captcha-img-wrapper img {
  height: 48px;
  width: auto;
}

.btn-refresh {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-refresh:hover {
  background: #e2e8f0;
  color: var(--text-dark);
}

.btn-refresh svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-submit {
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #0d9488 0%, #047857 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

.btn-submit:hover {
  background: linear-gradient(135deg, #0f766e 0%, #065f46 100%);
  box-shadow: 0 6px 12px -2px rgba(13, 148, 136, 0.3);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

.app-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Document / Multi-Media Viewer Full Screen Header & Layout */
.pdf-page-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: #0f172a;
}

.pdf-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  color: #f8fafc;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pdf-title-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

.pdf-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
}

.pdf-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-secondary {
  background: #334155;
  color: #f8fafc;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #475569;
}

.pdf-frame-wrapper {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.pdf-frame-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Media Viewer Containers (Image, Video, Documents) */
.media-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  overflow: auto;
  box-sizing: border-box;
}

.viewer-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  background: #ffffff;
}

.viewer-video {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  outline: none;
  background: #000000;
}

.doc-download-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  color: #f8fafc;
}

.doc-download-card .doc-icon-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem auto;
  background: rgba(13, 148, 136, 0.15);
  color: #2dd4bf;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-download-card .doc-icon-badge svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-download-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.doc-download-card p {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1.75rem;
  word-break: break-all;
}

.btn-primary-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0d9488 0%, #047857 100%);
  color: #ffffff;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.3);
}

.btn-primary-download:hover {
  background: linear-gradient(135deg, #0f766e 0%, #065f46 100%);
  transform: translateY(-1px);
}
