/* ============================================
   CAS Program Funding Application - Styles
   SUNY New Paltz Campus Auxiliary Services
   Built by FUZE (theFUZE.net)
   ============================================ */

:root {
  --np-blue: #003e73;
  --np-blue-light: #1a5a8e;
  --np-blue-pale: #ebf2f9;
  --np-orange: #f58426;
  --np-orange-pale: #fef3e7;
  --green: #2e7d32;
  --green-pale: #e8f5e9;
  --red: #d32f2f;
  --red-pale: #fdecea;
  --yellow: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- APP HEADER ---- */
.app-header {
  background: linear-gradient(135deg, var(--np-blue) 0%, var(--np-blue-light) 100%);
  color: white;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.app-header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.app-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.app-title span { color: var(--np-orange); }
.save-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  opacity: 0.85;
}
.save-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  transition: background 0.3s;
}
.save-dot.saving { background: var(--yellow); }
.save-dot.error { background: var(--red); }

/* ---- CONTAINER ---- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ---- HERO ---- */
.hero {
  background: var(--np-blue-pale);
  border-left: 4px solid var(--np-blue);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--np-blue);
  margin-bottom: 6px;
}
.hero p {
  font-size: 14px;
  color: var(--gray-500);
}

/* ---- SECTION ---- */
.section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.3s ease;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--np-blue);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .num {
  background: var(--np-blue);
  color: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.section-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

/* ---- FORM ELEMENTS ---- */
.form-group {
  margin-bottom: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required {
  color: var(--red);
  margin-left: 2px;
}
.form-label .hint {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 12px;
  margin-left: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  color: var(--gray-900);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--np-blue);
  box-shadow: 0 0 0 3px rgba(0,62,115,0.1);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}
input.currency {
  padding-left: 24px;
}
.currency-wrap {
  position: relative;
}
.currency-wrap::before {
  content: '$';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 15px;
  pointer-events: none;
}

/* Textarea with toolbar */
.textarea-wrap {
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.textarea-wrap:focus-within {
  border-color: var(--np-blue);
  box-shadow: 0 0 0 3px rgba(0,62,115,0.1);
}
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border: none;
  resize: vertical;
  min-height: 80px;
  outline: none;
  color: var(--gray-900);
  line-height: 1.6;
  transition: min-height 0.3s ease;
}
textarea.expanded {
  min-height: 240px;
}
.ta-toolbar {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}
.ta-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
}
.ta-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.ta-btn.pasted { background: var(--green-pale); border-color: var(--green); color: var(--green); }

/* Radio/Checkbox groups */
.radio-group {
  display: flex;
  gap: 16px;
  margin-top: 6px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: all var(--transition);
}
.radio-option:hover { border-color: var(--np-blue); background: var(--np-blue-pale); }
.radio-option.selected { border-color: var(--np-blue); background: var(--np-blue-pale); font-weight: 600; }
.radio-option input { display: none; }

/* ---- PROGRAM BLOCK ---- */
.program-block {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  animation: fadeUp 0.25s ease;
}
.program-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.program-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--np-blue);
}
.btn-remove-program {
  font-size: 12px;
  color: var(--red);
  background: none;
  border: 1px solid transparent;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-remove-program:hover { background: var(--red-pale); border-color: var(--red); }

/* ---- FILE UPLOAD ---- */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: white;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--np-blue);
  background: var(--np-blue-pale);
}
.upload-zone-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone-text { font-size: 14px; color: var(--gray-500); }
.upload-zone-text strong { color: var(--np-blue); }
.upload-zone-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

.file-list { margin-top: 12px; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  animation: fadeUp 0.2s ease;
}
.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.file-icon { font-size: 18px; flex-shrink: 0; }
.file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--gray-400); font-size: 12px; flex-shrink: 0; }
.file-remove {
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  transition: color var(--transition);
}
.file-remove:hover { color: var(--red); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--np-blue);
  color: white;
}
.btn-primary:hover { background: var(--np-blue-light); box-shadow: var(--shadow); }
.btn-orange {
  background: var(--np-orange);
  color: white;
}
.btn-orange:hover { filter: brightness(1.05); box-shadow: var(--shadow); }
.btn-outline {
  background: white;
  color: var(--np-blue);
  border-color: var(--gray-300);
}
.btn-outline:hover { border-color: var(--np-blue); background: var(--np-blue-pale); }
.btn-green {
  background: var(--green);
  color: white;
}
.btn-green:hover { filter: brightness(1.1); box-shadow: var(--shadow); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- ACTION BAR (sticky bottom) ---- */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 12px 24px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  z-index: 90;
}
.action-bar-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.action-bar-left { display: flex; gap: 8px; align-items: center; }
.action-bar-right { display: flex; gap: 8px; align-items: center; }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-info { background: var(--np-blue-pale); border-left: 4px solid var(--np-blue); color: var(--np-blue); }
.alert-success { background: var(--green-pale); border-left: 4px solid var(--green); color: var(--green); }
.alert-warning { background: var(--np-orange-pale); border-left: 4px solid var(--np-orange); color: #92400e; }
.alert-error { background: var(--red-pale); border-left: 4px solid var(--red); color: var(--red); }

/* ---- SUBMITTED STATE ---- */
.submitted-banner {
  background: var(--green-pale);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}
.submitted-banner h2 { color: var(--green); margin-bottom: 8px; }
.submitted-banner p { color: var(--gray-500); font-size: 14px; }

/* ---- CONDITIONAL SECTIONS ---- */
.conditional { display: none; }
.conditional.visible { display: block; animation: fadeUp 0.25s ease; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- PRINT ---- */
@media print {
  .app-header, .action-bar, .ta-toolbar, .upload-zone, .btn-remove-program { display: none !important; }
  .section { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .container { padding: 16px 12px 80px; }
  .section { padding: 20px 16px; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .radio-group { flex-direction: column; }
  .program-block { padding: 16px; }
  .action-bar { padding: 10px 12px; }
  .action-bar-inner { flex-direction: column; }
}
