/* ROM-E Elevate — Light Theme based on rom-etechnologies.com */

:root {
  --bg: #FFFFFF;
  --bg-alt: #F8F7FC;
  --surface: #FFFFFF;
  --surface-elevated: #F3F0FA;
  --foreground: #1a1230;
  --foreground-secondary: #5a5270;
  --foreground-tertiary: #8a8299;
  --accent: #B50EA5;
  --accent-hover: #9a0c8d;
  --accent-light: #d64ec8;
  --accent-bg: rgba(181, 14, 165, 0.06);
  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --border: #e8e4f0;
  --border-subtle: #f0ecf5;
  --glow: rgba(181, 14, 165, 0.15);
  --shadow-sm: 0 1px 3px rgba(26, 18, 48, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 18, 48, 0.08);
  --shadow-lg: 0 8px 24px rgba(26, 18, 48, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg-alt);
  color: var(--foreground);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Background Hero Images — 3 variants */
.bg-hero {
  background: url('/assets/images/fondo2.jpg') center center / cover no-repeat fixed;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -2;
  opacity: 0.35;
}

.bg-hero-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  background: linear-gradient(180deg, rgba(248,247,252,0.82) 0%, rgba(255,255,255,0.85) 50%, rgba(248,247,252,0.82) 100%);
}

/* Loading Screen */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
  background: var(--bg);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: none;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--foreground);
}

.loading-text {
  color: var(--foreground-secondary);
  font-size: 14px;
}

/* Layout */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.header .logo { gap: 8px; }
.header .logo-icon { width: 36px; height: 36px; }
.header .logo-text { font-size: 18px; letter-spacing: 0.1em; }

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground-secondary);
  font-size: 14px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.3;
}

/* Expire Banner */
.expire-banner {
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
  padding: 10px 24px;
  text-align: center;
  font-size: 13px;
  color: #92400e;
}

/* Progress Bar */
.progress-section {
  padding: 24px;
}

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

.progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-count {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Video Card */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px 24px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.video-card:hover:not(.locked) {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 20px var(--glow);
  transform: translateY(-1px);
}

.video-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.video-card.completed {
  border-color: var(--success);
  opacity: 0.8;
}

.video-card.active {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 20px var(--glow);
}

.video-number {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.video-card.locked .video-number {
  background: var(--surface-elevated);
  color: var(--foreground-tertiary);
}

.video-card.active .video-number {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--glow);
}

.video-card.completed .video-number {
  background: var(--success);
  color: #FFFFFF;
}

.video-info { flex: 1; }

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--foreground);
}

.video-subtitle {
  font-size: 13px;
  color: var(--foreground-secondary);
}

.video-status {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.video-status.completed {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.video-status.in-progress {
  background: var(--accent-bg);
  color: var(--accent);
}

.video-status.locked {
  background: var(--surface-elevated);
  color: var(--foreground-tertiary);
}

/* Video Player Page */
.video-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--foreground-secondary);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

.video-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #1a1230;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

.video-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--foreground);
}

.video-page-description {
  font-size: 15px;
  color: var(--foreground-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Quiz */
.quiz-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.quiz-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.quiz-subtitle {
  font-size: 14px;
  color: var(--foreground-secondary);
  margin-bottom: 24px;
}

.quiz-question { margin-bottom: 24px; }

.quiz-question-text {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.quiz-question-number {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: var(--foreground);
}

.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.quiz-option.selected {
  border-color: var(--accent);
  background: rgba(181, 14, 165, 0.08);
  box-shadow: 0 0 0 3px var(--glow);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(22, 163, 74, 0.08);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: rgba(220, 38, 38, 0.06);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 4px 12px var(--glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px var(--glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--glow);
}

.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Quiz Result */
.quiz-result {
  text-align: center;
  padding: 32px;
}

.quiz-result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
}

.quiz-result-icon.pass {
  background: rgba(22, 163, 74, 0.1);
  border: 2px solid var(--success);
}

.quiz-result-icon.fail {
  background: rgba(220, 38, 38, 0.08);
  border: 2px solid var(--error);
}

.quiz-result-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.quiz-result-text {
  font-size: 15px;
  color: var(--foreground-secondary);
  margin-bottom: 24px;
}

/* Certificate */
.certificate-container {
  text-align: center;
  padding: 48px 24px;
  background: url('/assets/images/fondo3.jpg') center center / cover no-repeat;
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.certificate-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.certificate-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 40px;
  box-shadow: 0 0 32px var(--glow);
}

.certificate-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--foreground);
}

.certificate-text {
  font-size: 16px;
  color: var(--foreground-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.certificate-code {
  font-size: 13px;
  color: var(--foreground-tertiary);
  margin-top: 16px;
}

/* Expired / Invalid Access */
.expired-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
  padding: 24px;
  background: url('/assets/images/fondo.jpg') center center / cover no-repeat;
  position: relative;
}

.expired-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.expired-container > *,
.certificate-container > * {
  position: relative;
  z-index: 1;
}

.expired-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.08);
  border: 2px solid var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 32px;
}

/* Admin Dashboard */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-title {
  font-size: 24px;
  font-weight: 700;
}

.invite-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.invite-form input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

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

.invite-form input::placeholder {
  color: var(--foreground-tertiary);
}

.participant-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.participant-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.participant-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.participant-table tr:hover td {
  background: var(--bg-alt);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

.status-badge.completed { background: rgba(22, 163, 74, 0.1); color: var(--success); }
.status-badge.in-progress { background: var(--accent-bg); color: var(--accent); }
.status-badge.not-started { background: var(--surface-elevated); color: var(--foreground-tertiary); }
.status-badge.expired { background: rgba(220, 38, 38, 0.06); color: var(--error); }

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .video-list { padding: 0 16px 16px; }
  .video-card { padding: 16px; gap: 12px; }
  .video-number { width: 40px; height: 40px; font-size: 16px; }
  .quiz-container { padding: 24px 16px; }
  .invite-form { flex-direction: column; }
  .participant-table { font-size: 13px; }
  .participant-table th, .participant-table td { padding: 10px 8px; }
}
