/* Prevent Alpine.js flicker before initialization */
[x-cloak] {
  display: none !important;
}

/* Modern CSS for Workast Auth Pages */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f0f2f5;
}

/* Main container */
.modern-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Card container */
.modern-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding: 0px 40px 40px 40px; /* Extra top padding for overlapping logo */
  width: 100%;
  max-width: 400px;
  position: relative;
  margin-top: 32px;
}

/* Logo container */
.logo-container {
  display: flex;
  justify-content: center;
  margin-top: -32px;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
}

/* Typography */
h1.card-title {
  font-size: 22px;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.25;
}

h2.card-title {
  font-size: 18px;
  color: #374151;
  margin: 24px 0 12px 0;
  line-height: 1.25;
}

p.card-text {
  font-size: 14px;
  color: #4b5563;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

/* Form styles */
.modern-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.modern-input {
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: white;
}

.modern-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-input::placeholder {
  color: #9ca3af;
}

/* Button styles */
.modern-btn {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.modern-btn-primary {
  background-color: #3b82f6;
  color: white;
}

.modern-btn-primary:hover {
  background-color: #2563eb;
}

.modern-btn-secondary {
  background-color: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.modern-btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

/* Divider */
.divider {
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
  margin: 8px 0;
}

/* Error banner */
.error-banner {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.error-banner button {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Terms and privacy */
.terms-text {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  margin-top: 24px;
  line-height: 1.5;
}

.terms-text a {
  color: #3b82f6;
  text-decoration: none;
}

.terms-text a:hover {
  text-decoration: underline;
}

/* Slack icon */
.slack-icon {
  width: 20px;
  height: 20px;
}

/* Responsive design */
@media (max-width: 480px) {
  .modern-container {
    padding: 16px;
  }
  
  .modern-card {
    padding: 24px;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  .modern-input,
  .modern-btn {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* Hidden elements */
.hidden {
  display: none !important;
}

/* Focus styles for accessibility */
.modern-btn:focus,
.modern-input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Loading state */
.modern-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Digit input styles */
.digit-input-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.digit-box {
  width: 48px;
  height: 56px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: #374151;
  background-color: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.digit-box:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.digit-box.error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.digit-box.error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-text {
  font-size: 14px;
  color: #dc2626;
  text-align: center;
  margin-top: 8px;
  font-weight: 500;
}

/* Responsive adjustments for digit input */
@media (max-width: 480px) {
  .digit-box {
    width: 44px;
    height: 52px;
    font-size: 20px;
  }
  
  .digit-input-container {
    gap: 6px;
  }
}

/* Workspace list styles */
.workspace-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
}

.workspace-item {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.workspace-item:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.workspace-item:active {
  background-color: #f3f4f6;
}

.workspace-item.hidden {
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: none;
  overflow: hidden;
  transition: opacity 0.3s, height 0.3s, padding 0.3s, margin 0.3s;
}

.workspace-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-right: 12px;
  flex-shrink: 0;
}

.workspace-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.workspace-name {
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 2px 0;
  line-height: 1.25;
}

.workspace-url {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.workspace-separator {
  height: 1px;
  background-color: #e5e7eb;
  margin: 16px 0;
}

.loading-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  color: #374151;
  margin: 24px 0;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments for workspace list */
@media (max-width: 480px) {
  .workspace-item {
    padding: 12px;
  }
  
  .workspace-icon {
    width: 36px;
    height: 36px;
    margin-right: 10px;
  }
  
  .workspace-name {
    font-size: 15px;
  }
  
  .workspace-url {
    font-size: 13px;
  }
}

/* Multi-step signup styles */
.signup-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.step-content {
  /* Fill available width so split layout can span full width */
  width: 100%;
  flex: 1 1 auto;
}

.step-content.hidden {
  display: none;
}

/* Avatar preview styles */
.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #f3f4f6;
}

/* File input wrapper */
.file-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background-color: #f9fafb;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.file-input-label:hover {
  border-color: #3b82f6;
  background-color: #f0f9ff;
  color: #3b82f6;
}

.workspace-preview-form-container {
  max-width: 400px;
  margin: 0 auto;
}

/* Workspace preview panel */
.workspace-preview {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  min-height: 590px;
  display: flex;
  flex-direction: column;
  margin-right: -34px;
  flex: 1;
}

.workspace-preview-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.workspace-preview-header-spacer {
  flex: 1;
}

.workspace-preview-name {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
}

.workspace-preview-body {
  display: flex;
  grid-template-columns: 280px 1fr;
  gap: 0;
  flex: 1;
  border: 1px solid #f1f5f9;
  border-right: none;
  border-radius: 6px 0 0 6px;
  overflow: hidden;
  width: 100%;
}

.workspace-preview-sidebar {
  background-color: #1F2432;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid #141923;
  width: 260px;
}

.workspace-preview-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.sidebar-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0; /* allow ellipsis */
}

.sidebar-workspace {
  color: white;
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user {
  color: #cbd5e1;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.caret-down {
  width: 0; 
  height: 0; 
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #cbd5e1;
}

.workspace-preview-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-preview-section-title {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.workspace-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 10px;
  background-color: rgba(255,255,255,0.08);
  border-radius: 6px;
}

.workspace-preview-main {
  background-color: #ffffff;
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.workspace-preview-content-header {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
}

.skeleton-dot {
  width: 12px;
  height: 12px;
  background-color: #eef2f7;
  border-radius: 50%;
}

.workspace-preview-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skeleton-chip {
  width: 44px;
  height: 10px;
  background-color: #eef2f7;
  border-radius: 999px;
}

.workspace-preview-panel {
  flex: 1;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  background-color: #ffffff;
}

/* Split layout for step 2 */
.signup-split-layout {
  display: flex;
  gap: 32px;
  align-items: start;
  width: 100%;
}

.workspace-info {
  flex: 1;
  min-width: 50%;
}

/* Selection tag styles */
.selection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.selection-option {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.selection-option:hover {
  border-color: #3b82f6;
  background-color: #f0f9ff;
}

.selection-option.selected {
  border-color: #3b82f6;
  background-color: #3b82f6;
  color: white;
}

/* Form section headers */
.form-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 24px 0 12px 0;
}

.form-section-title:first-child {
  margin-top: 0;
}

/* Responsive adjustments for signup */
@media (max-width: 768px) {
  .signup-split-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-right: 0;
  }
  
  .selection-grid {
    gap: 6px;
  }
  
  .workspace-preview {
    min-height: 260px;
  }
}

@media (max-width: 480px) {
  .selection-option {
    padding: 5px 10px;
    font-size: 13px;
  }
  
  .workspace-preview {
    min-height: 220px;
  }
}

/* Selected business type card */
.business-card {
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.business-card:hover {
  border-color: #3b82f6;
  background-color: #f0f9ff;
}

.business-card-selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.business-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.business-card-description {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.start-over-link {
  font-size: 14px;
  color: #6b7280;
  text-decoration: none;
  cursor: pointer;
  display: block;
  text-align: center;
  margin-top: 16px;
  transition: color 0.2s;
}

.start-over-link:hover {
  color: #3b82f6;
  text-decoration: underline;
}


/* Workspace preview list items */
.workspace-preview-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
  position: relative;
  cursor: pointer;
  margin: -2px 0 -2px -6px;
}

.workspace-preview-list-note {
  font-size: 14px;
  color: #9CA3AF;
  margin-top: 8px;
}

.workspace-preview-list-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.space-name {
  color: #cbd5e1;
  font-size: 13px;
  flex: 1;
}

.remove-space-btn {
  opacity: 1;
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: opacity 0.2s;
}

.workspace-preview-list-item.hover .remove-space-btn,
.workspace-preview-list-item:hover .remove-space-btn {
  opacity: 1;
}

.remove-space-btn:hover {
  color: #dc2626;
}

