:root {
  --bg-color: #0b0f19;
  --card-bg: rgba(13, 17, 23, 0.88);
  --terminal-bg: #0d1117;
  --border-color: #1f2937;
  --accent-color: #3b82f6;
  --accent-green: #10b981;
  --danger-color: #ef4444;
  --text-primary: #f3f4f6;
  --text-muted: #9ca3af;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0b0f19;
}
::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

.video-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 45%),
    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 45%),
    var(--bg-color);
}

#bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mparamos-line {
  height: 2px;
  width: 100%;
  background: linear-gradient(to right, #10b981, #3b82f6);
  border-radius: 2px;
}

a.mparamos-link {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  color: #10b981;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid transparent;
}

a.mparamos-link:hover {
  transform: scale(1.04);
  color: transparent;
  font-weight: 700;
  background-image:
    linear-gradient(90deg, #10b981, #3b82f6, #10b981),
    linear-gradient(#0b0f19, #0b0f19),
    linear-gradient(90deg, #10b981, #3b82f6, #10b981);
  background-size: 200% auto, 100% 100%, 200% auto;
  -webkit-background-clip: text, padding-box, border-box;
  background-clip: text, padding-box, border-box;
  background-origin: border-box, padding-box, border-box;
  animation: rotarColores 3s linear infinite;
}

@keyframes rotarColores {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.site-header {
  background-color: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(to right, #10b981, #3b82f6) 1;
  padding: 0.65rem 1.25rem;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-logo {
  height: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

.brand-titles {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.site-subtitle {
  font-size: 0.78rem;
  color: var(--accent-color);
  font-weight: 500;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.toolbar-meta,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: rgba(13, 17, 23, 0.85);
}

.badge-student {
  color: #e2e8f0;
  border-color: rgba(59, 130, 246, 0.45);
}

.status-loading {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.status-ready {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.45);
}
.status-busy {
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.45);
}
.status-error {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(90deg, #10b981, #3b82f6);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.55);
}

.btn-secondary {
  background: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  border-color: #374151;
}

.btn-secondary:hover:not(:disabled) {
  background: #1f2937;
  border-color: #60a5fa;
}

.btn-danger-outline {
  background: rgba(127, 29, 29, 0.25);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-danger-outline:hover:not(:disabled) {
  background: rgba(153, 27, 27, 0.55);
}

.btn-danger {
  background: #dc2626;
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-block {
  width: 100%;
  padding: 0.7rem 1rem;
}

.main-stage {
  flex: 1;
  display: flex;
  padding: 0.85rem 1.25rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.terminal-card {
  flex: 1;
  display: flex;
  min-height: 460px;
  background: var(--terminal-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.9rem;
  padding: 0.6rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.terminal-container {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.site-footer {
  background-color: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 3px solid transparent;
  border-image: linear-gradient(to right, #10b981, #3b82f6) 1;
  padding: 0.65rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-link,
.footer-btn-link {
  color: #60a5fa;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.footer-link:hover,
.footer-btn-link:hover {
  text-decoration: underline;
  color: #93c5fd;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 15, 0.84);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#helpModal,
#licensesModal {
  z-index: 110;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  background: var(--card-bg);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card:has(.modal-body) {
  overflow: hidden;
}

.modal-card--wide {
  max-width: 560px;
}

.modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #374151;
  background: rgba(17, 24, 39, 0.9);
  color: #e5e7eb;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.modal-close-btn:hover {
  background: #1f2937;
  border-color: #60a5fa;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.2rem;
}

.modal-title {
  font-size: 1.2rem;
  color: #ffffff;
}

.modal-intro {
  font-size: 0.9rem;
  color: #d1d5db;
}

.tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(11, 15, 25, 0.75);
  padding: 0.3rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.6rem;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.is-active {
  background: rgba(59, 130, 246, 0.2);
  color: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-group label {
  font-size: 0.85rem;
  color: #e5e7eb;
  font-weight: 600;
}

.req {
  color: #34d399;
}

.opt {
  color: var(--text-muted);
  font-weight: 400;
}

.field-group input[type="text"],
.file-input {
  width: 100%;
  background: #0d1117;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.92rem;
  outline: none;
}

.field-group input[type="text"]:focus,
.file-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.resume-preview {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 0.6rem;
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #d1fae5;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.privacy-box {
  background: rgba(11, 15, 25, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 0.6rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
  border-radius: 0.55rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.84rem;
}

.help-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 0.85rem;
  font-size: 0.86rem;
}

.help-list dt {
  font-weight: 700;
  color: #34d399;
}

.help-list dd {
  color: #d1d5db;
}

.license-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #d1d5db;
}

.license-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(31, 41, 55, 0.7);
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-card {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    padding: 1rem;
    gap: 0.65rem;
    border-radius: 0.85rem;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-intro {
    font-size: 0.84rem;
  }

  .help-list {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    font-size: 0.82rem;
  }

  .help-list dt {
    margin-top: 0.45rem;
  }

  .help-list dt:first-child {
    margin-top: 0;
  }

  .help-list dd {
    margin: 0;
    line-height: 1.4;
  }

  .modal-actions {
    justify-content: stretch;
  }

  .modal-actions .btn {
    flex: 1 1 auto;
  }
}
