/* ==========================================
   PalmFlow Dashboard - Main Stylesheet
   Optimized for performance and maintainability
   ========================================== */

/* CSS Variables */
   /* Modern CSS Foundation */

   /* Enhanced Typography for Index Page */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #1f2937;
}

* {
  box-sizing: border-box;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); 
  margin: 0; 
  padding: 0; 
  min-height: 100vh;
  line-height: 1.6;
}

.card { 
  background: rgba(255, 255, 255, 0.95); 
  backdrop-filter: blur(20px);
  border-radius: 16px; 
  padding: 2.5rem; 
  margin: 1rem; 
  box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s ease;
  max-width: 430px;
  width: 100%;
  margin: 2.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

input[type="text"], input[type="email"], input[type="password"], select, textarea { 
  width: 100%; 
  padding: 1rem; 
  margin: 0.5rem 0; 
  font-size: 1rem; 
  border: 2px solid #e2e8f0; 
  border-radius: 12px; 
  transition: all 0.3s ease;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

button { 
  padding: 1rem 1.5rem; 
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
  color: white; 
  border: none; 
  border-radius: 12px; 
  font-size: 1rem; 
  cursor: pointer; 
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

#continueBtn {
  margin-top: 1.3rem;
}

button:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.error { 
  color: var(--danger); 
  margin-top: 0.5rem; 
  font-weight: 500;
  background: #fef2f2;
  padding: 0;
  border-radius: 12px;
  border-left: 4px solid transparent;
  min-height: 0;
}

.error:not(:empty) {
  padding: 1rem;
  border-left-color: var(--danger);
}

.form-section { 
  margin-top: 2rem; 
  padding: 2rem; 
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%); 
  border-left: 4px solid var(--primary); 
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.form-section h3 { 
  margin: 0 0 1rem; 
  color: var(--gray-900);
  font-weight: 700;
}

.timestamp { 
  color: var(--gray-500); 
  font-size: 0.9rem; 
  margin-top: 1rem; 
  font-style: italic;
}

/* Keep all your existing layout CSS exactly as is */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: 280px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
  backdrop-filter: blur(20px);
  color: white;
  padding: 0;
  display: none;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  padding: 2rem 1.5rem 1rem;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar ul {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

.sidebar li {
  margin: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.main-content {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
}

.branding-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  padding: 2rem 2.5rem;
  margin: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.org-name {
  font-size: 1.75rem;
  color: var(--gray-900);
  margin: 0;
  font-weight: 700;
}

/* Keep existing responsive design */
@media (max-width: 768px) {
  .app-wrapper { flex-direction: column; }
  #sidebar { width: 100%; }
  .main-content { padding: 1rem; }
  .card {
    margin: 0.5rem auto;
    padding: 1.5rem;
    max-width: 98vw;
  }
}

/* Keep all your existing menu, status, and table styles exactly as they were */
.menu-item {
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.menu-item:hover {
  background: rgba(59, 130, 246, 0.15);
  border-left-color: #60a5fa;
  transform: translateX(8px);
}

.menu-item.active {
  background: rgba(59, 130, 246, 0.2);
  border-left-color: var(--primary);
  color: #93c5fd;
  font-weight: 600;
}

#logoutMenuLink {
  color: #f87171;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  transition: all 0.3s ease;
}

#logoutMenuLink:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}

.status-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-client-submitted { background: var(--warning); }
.status-advisor-submitted { background: var(--primary); }
.status-closed { background: var(--success); }
.status-created { background: var(--gray-500); }
.status-partially-submitted { background: var(--danger); }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

th, td {
  padding: 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
}

th {
  background: var(--gray-100);
  font-weight: 700;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
}

tr:hover {
  background: rgba(59, 130, 246, 0.05);
  transform: translateX(4px);
}

tr:last-child td {
  border-bottom: none;
}

h1, h2, h3 {
  color: var(--gray-900);
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

#advisorName {
  color: var(--gray-500);
  font-weight: 500;
  font-size: 1.1rem;
}

label {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  display: block;
}
/* Step 2: Enhanced Interactive Elements */

/* Enhanced button variations */
button[onclick="copyClientCode()"] {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

button[onclick="copyClientCode()"]:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

button[onclick*="archiveForm"] {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

button[onclick*="archiveForm"]:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

/* Enhanced form sections */
#generatedCodeDisplay {
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.9) 0%, rgba(219, 234, 254, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(10px);
}

.password-requirements {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, rgba(219, 234, 254, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(10px);
}

/* Success messages */
.success {
  color: var(--success);
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  padding: 1rem;
  border-radius: 12px;
  border-left: 4px solid var(--success);
  font-weight: 500;
}

/* Enhanced legal footer */
#legalFooter {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  margin-top: 2rem;
}

/* Enhanced expanded form details */
.expanded-form-details td > div {
  background: linear-gradient(135deg, rgba(249, 250, 251, 0.95) 0%, rgba(243, 244, 246, 0.95) 100%);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Card hover effects */
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

/* Smooth transitions for all elements */
* {
  transition: all 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.5);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.tooltip { position: relative; cursor: help; }
.tooltiptext { 
  visibility: hidden; position: absolute; background: #333; 
  color: white; padding: 5px; border-radius: 4px; 
  font-size: 12px; width: 200px; bottom: 125%; left: 50%; 
  transform: translateX(-50%); z-index: 1; 
}
.tooltip:hover .tooltiptext { visibility: visible; }



/* Update body font family */
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
}

/* Enhanced main title */
.main-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
  text-align: center;
}

/* Enhanced subtitle */
.subtitle-container {
  text-align: center;
  margin-bottom: 2rem;
}

.subtitle {
  font-size: 1.1rem;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.subtitle-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.3));
}

.description {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* Enhanced instruction text */
.instruction-text {
  font-size: 1rem;
  color: #374151;
  font-weight: 500;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Enhanced input styling */
#codeInput {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  font-size: 1.1rem;
  color: #1f2937;
}

#codeInput::placeholder {
  color: #9ca3af;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* Enhanced legal text */
.legal-disclaimer {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.5;
  text-align: center;
  margin-top: 1.5rem;
}

.legal-disclaimer a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.legal-disclaimer a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Enhanced footer */
#legalFooter {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.8) 100%);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.footer-links a {
  padding: 12px 12px;              /* bigger hit area */
  margin: 4px;                     /* space between links */
  min-width: 44px;                 
  min-height: 44px;                /* WCAG min target */
  line-height: 1.2;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}

.footer-links a:hover {
  color: #1d4ed8;
  transform: translateY(-1px);
}

.copyright {
  font-weight: 400;
  color: #9ca3af;
}

/* Add subtle animation */
.card {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0.01;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}