/* 🎨 Modern & Stylish Portal Design */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* Root Variables */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark-bg: #0f172a;
  --card-bg: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
}

/* Typography & Global */
html {
  box-sizing: border-box;
  font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
}

*,*::before,*::after { box-sizing: inherit; }

body {
  margin: 0;
  color: var(--text-primary);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--primary-dark); }

button, input, textarea, select {
  font: inherit;
  family: 'Poppins', sans-serif;
}

button { cursor: pointer; }

/* Layout */
.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.5s ease-out;
}

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

.page-card {
  width: min(100%, 1100px);
  animation: slideUp 0.6s ease-out;
}

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

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding: 0;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
}

.brand-logo img:hover {
  transform: scale(1.08);
}

.brand-copy {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.brand-copy h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-copy p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
  color: rgba(255,255,255,0.95);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header nav a {
  padding: 8px 16px;
  border-radius: 10px;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

.site-header nav a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-2px);
}

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  transform: translateY(-4px);
}

.auth-panel, .form-panel, .submission-panel {
  padding: 40px;
}

.auth-panel h1, .form-panel h2, .submission-panel h2 {
  margin: 0 0 16px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-panel p, .form-panel p, .submission-panel p {
  margin: 0 0 24px;
  line-height: 1.8;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field {
  width: 100%;
  padding: 14px 18px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border: 2px solid var(--border-light);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.field:hover {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.field:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.textarea {
  min-height: 140px;
  resize: vertical;
  font-family: 'Inter', monospace;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: var(--text-primary);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  border-color: var(--primary-light);
}

/* Toggle & Inputs */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

.note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Info & Alert Cards */
.info-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.05) 0%, rgba(118,75,162,0.05) 100%);
  border: 2px solid rgba(99,102,241,0.15);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.info-card:hover {
  border-color: rgba(99,102,241,0.3);
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(118,75,162,0.1) 100%);
}

.info-card p {
  margin: 0 0 12px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.alert {
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.alert-error {
  background: linear-gradient(135deg, rgba(239,68,68,0.1) 0%, rgba(220,38,38,0.05) 100%);
  color: #991b1b;
  border: 2px solid rgba(239,68,68,0.3);
}

.alert-success {
  background: linear-gradient(135deg, rgba(16,185,129,0.1) 0%, rgba(5,150,105,0.05) 100%);
  color: #166534;
  border: 2px solid rgba(16,185,129,0.3);
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

.submission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.submission-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 2px solid var(--border-light);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submission-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.submission-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.submission-card h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.meta-chip {
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(118,75,162,0.1) 100%);
  color: var(--primary-dark);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid rgba(99,102,241,0.3);
  transition: all 0.2s ease;
}

.meta-chip:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(118,75,162,0.2) 100%);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(118,75,162,0.1) 100%);
  color: var(--primary-dark);
  font-size: 0.9rem;
  word-break: break-word;
  border: 1px solid rgba(99,102,241,0.3);
  font-weight: 600;
  transition: all 0.2s ease;
}

.file-pill:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(118,75,162,0.2) 100%);
  border-color: rgba(99,102,241,0.5);
  transform: translateY(-2px);
}

.file-pill a {
  color: inherit;
  font-weight: 700;
}

.submission-card p {
  margin: 0 0 16px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.submission-card p strong {
  color: var(--text-primary);
  font-weight: 700;
}

.submission-card a.action-link {
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.submission-card a.action-link:hover {
  color: var(--primary-dark);
  gap: 10px;
}

.summary-text {
  white-space: pre-wrap;
  background: rgba(99,102,241,0.05);
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

/* Footer */
footer {
  margin-top: 32px;
  text-align: center;
  color: rgba(17,24,39,0.6);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Responsive */
@media(max-width: 768px) {
  .page-shell { padding: 16px; }
  
  .site-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .site-header nav {
    width: 100%;
    justify-content: center;
  }
  
  .brand-logo {
    justify-content: center;
    width: 100%;
  }
  
  .auth-panel, .form-panel, .submission-panel {
    padding: 28px;
  }
  
  .auth-panel h1, .form-panel h2, .submission-panel h2 {
    font-size: 1.6rem;
  }
  
  .btn {
    width: 100%;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .submission-card {
    padding: 20px;
  }
}

@media(max-width: 480px) {
  .page-shell { padding: 12px; }
  
  .card {
    border-radius: 18px;
    box-shadow: var(--shadow-md);
  }
  
  .auth-panel, .form-panel, .submission-panel {
    padding: 20px;
  }
  
  .auth-panel h1, .form-panel h2, .submission-panel h2 {
    font-size: 1.4rem;
  }
  
  .site-header nav a {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
  
  .brand-copy h1 {
    font-size: 1.2rem;
  }
}