/* AlgoOS Start - Dark Theme */

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

:root {
  --bg: #0a0a0f;
  --card-bg: #12121a;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #eab308;
  --neutral: #71717a;
  --border: #27272a;
  --input-bg: #1a1a24;
  --input-border: #3f3f46;
  --radius: 8px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.25rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}

.checklist-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.checklist-item:first-of-type {
  padding-top: 0;
}

.checklist-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--input-border);
  border-radius: 4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checklist-checkbox:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.checklist-checkbox:checked + .checkmark::after {
  content: '';
  display: block;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.checklist-content {
  flex: 1;
}

.checklist-content strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.checklist-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.checklist-desc a {
  color: var(--accent);
  text-decoration: none;
}

.checklist-desc a:hover {
  text-decoration: underline;
}

.screenshot-placeholder {
  background: #1a1a24;
  border: 1px dashed var(--input-border);
  border-radius: 6px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--neutral);
  font-size: 0.8rem;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input::placeholder {
  color: var(--neutral);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.input-wrapper {
  position: relative;
}

.input-wrapper .form-input {
  padding-right: 2.75rem;
}

.toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--neutral);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-btn:hover {
  color: var(--text-secondary);
}

.eye-icon {
  width: 20px;
  height: 20px;
}

/* Button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary .spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.5rem;
}

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

/* Error message */
.error-msg {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 6px;
}

/* Results */
#results {
  margin-top: 1.25rem;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 6px;
  background: var(--bg);
  animation: fadeIn 0.3s ease;
}

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

.result-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 1px;
}

.result-icon.pass {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.result-icon.fail {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.result-icon.unknown {
  background: rgba(113, 113, 122, 0.15);
  color: var(--neutral);
}

.result-content {
  flex: 1;
}

.result-message {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.result-fix {
  font-size: 0.8rem;
  color: var(--warning);
  margin-top: 0.25rem;
}

/* Banners */
.banner {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.banner.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.banner.warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: var(--warning);
}

.banner p {
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.banner a.btn-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--success);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.banner a.btn-link:hover {
  opacity: 0.9;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--text-secondary);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding-bottom: 1rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 1rem;
  color: var(--neutral);
  font-size: 0.8rem;
}

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 0.5rem;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  color: var(--neutral);
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .logo {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.1rem;
  }
}
/* ---------- Success Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.modal-icon svg {
  width: 36px;
  height: 36px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.modal-cta {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-cta:hover {
  opacity: 0.9;
}

.modal-close {
  display: inline-block;
  margin-top: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ---------- Invite Code Block in Modal ---------- */

.modal-code-block {
  margin: 1.25rem 0 1.75rem;
}

.modal-code-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.modal-code-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.modal-code-value {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
  letter-spacing: 0.02em;
}

.modal-code-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  min-width: 100px;
  transition: background 0.2s;
}

.modal-code-copy:hover {
  background: var(--accent-hover);
}

.modal-code-copy.copied {
  background: var(--success);
}
