/* Dash - Mobile-first styles */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #22c55e;
  --error: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  line-height: 1.5;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Header */
.header {
  text-align: center;
  padding: 20px 0 30px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
}

.header .domain {
  color: var(--primary);
}

/* Screens */
.screen {
  animation: fadeIn 0.3s ease;
}

.screen.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

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

/* Login Screen */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
}

.hero-illustration {
  margin-bottom: 24px;
}

.victory-svg {
  width: 180px;
  height: 140px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.welcome-text {
  margin-bottom: 30px;
}

.tagline {
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.tagline .blank {
  color: var(--primary);
  letter-spacing: 2px;
}

.hint {
  margin-top: 16px;
  font-size: 14px;
  color: var(--gray-400);
}

/* Loading Screen */
#loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* User Header */
.user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-logout {
  margin-left: auto;
  padding: 8px;
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#user-greeting {
  font-weight: 600;
  font-size: 16px;
}

.status-badge {
  font-size: 12px;
  color: var(--gray-500);
}

.status-badge.returning {
  color: var(--primary);
}

/* Form */
#project-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-700);
}

.optional {
  font-weight: 400;
  color: var(--gray-400);
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Subdomain input */
.subdomain-input {
  display: flex;
  align-items: center;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.subdomain-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.subdomain-input input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}

.subdomain-input input:focus {
  box-shadow: none;
}

.subdomain-suffix {
  padding: 12px 14px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 14px;
  white-space: nowrap;
}

/* GitHub input */
.github-input {
  display: flex;
  align-items: center;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.github-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.github-input input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}

.github-input input:focus {
  box-shadow: none;
}

.github-prefix {
  padding: 12px 14px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 14px;
  white-space: nowrap;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  cursor: pointer;
}

.chip input {
  display: none;
}

.chip span {
  padding: 8px 14px;
  font-size: 14px;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  transition: all 0.2s;
}

.chip input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.chip:active span {
  transform: scale(0.96);
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

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

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

/* Success Screen */
#success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  background: var(--success);
  border-radius: 50%;
  margin-bottom: 20px;
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

#success-screen h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

#success-screen p {
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* Error Screen */
#error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.error-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: bold;
  color: white;
  background: var(--error);
  border-radius: 50%;
  margin-bottom: 20px;
}

#error-screen h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

#error-screen p {
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 380px) {
  .container {
    padding: 16px;
  }

  .subdomain-suffix,
  .github-prefix {
    font-size: 13px;
    padding: 12px 10px;
  }
}
