/* ============================================================
   Achieve by Simply Succeed — College Essay Theme Planner
   Main Stylesheet
   ============================================================ */

/* ── Reset & Variables ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Achieve Brand Colors ── */
  --primary:       #1B1B1B;
  --primary-dark:  #000000;
  --primary-light: #f4f6fc;
  --accent:        #8cd888;
  --accent-yellow: #e5e97c;
  --accent-orange: #f7915a;
  --success:       #8cd888;
  --warning:       #e5e97c;
  --danger:        #f7915a;
  --bg:            #f4f6fc;
  --surface:       #FFFFFF;
  --surface2:      #f4f6fc;
  --border:        #E2E8F0;
  --text:          #1B1B1B;
  --text-muted:    #5a5a5a;
  --text-light:    #9a9a9a;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
  --shadow-md:     0 4px 6px rgba(0,0,0,.07), 0 10px 15px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px rgba(0,0,0,.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 20px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.header-logo {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: #fff;
}
.header-logo-img {
  height: 48px;
  width: 48px;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-logo-tagline {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}
.header-badge {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--primary);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Progress Steps ──────────────────────────────────────── */
.steps-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.steps-list {
  display: flex; gap: 0; list-style: none;
  justify-content: center;
  counter-reset: step;
}
.step-item {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted);
  padding: 6px 18px;
  border-radius: 30px;
  transition: all .2s;
  cursor: default;
  user-select: none;
}
.step-item::before {
  counter-increment: step;
  content: counter(step);
  width: 22px; height: 22px;
  background: var(--surface2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  flex-shrink: 0;
}
.step-item.active {
  color: var(--primary);
  background: #e8f5e8;
}
.step-item.active::before {
  background: var(--accent);
  color: var(--primary);
}
.step-item.done { color: #2d7a2a; }
.step-item.done::before { background: var(--accent); color: var(--primary); content: "✓"; }

/* ── Main Page Layout ────────────────────────────────────── */
.page { display: none; padding: 36px 0 60px; }
.page.active { display: block; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 1rem; font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: .8rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
label .required { color: var(--danger); margin-left: 3px; }

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140,216,136,.25);
}
textarea { resize: vertical; min-height: 80px; }

/* ── Autocomplete ────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.autocomplete-dropdown.open { display: block; }
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.focused { background: var(--primary-light); }
.autocomplete-item mark {
  background: none; color: var(--primary); font-weight: 700;
}
.autocomplete-item-badge {
  font-size: .68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 12px;
  background: var(--surface2); color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.autocomplete-item-badge.honors { background: #FEF3C7; color: #92400E; }
.autocomplete-no-results {
  padding: 14px; color: var(--text-muted); font-size: .9rem; text-align: center;
}
.search-hint {
  font-size: .75rem; color: var(--text-light); margin-top: 4px;
}

/* ── College Entries ─────────────────────────────────────── */
.college-entries { display: flex; flex-direction: column; gap: 18px; }
.college-entry {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  transition: border-color .2s;
}
.college-entry:focus-within { border-color: var(--primary); }
.college-entry-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.college-entry-num {
  font-size: .75rem; font-weight: 700; color: var(--text-muted);
  background: var(--border);
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.college-entry-title { font-weight: 600; font-size: .95rem; flex: 1; }
.btn-remove-college {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); padding: 4px;
  border-radius: 6px; transition: color .15s, background .15s;
  display: flex; align-items: center;
}
.btn-remove-college:hover { color: var(--danger); background: #FEE2E2; }
.btn-remove-college svg { width: 16px; height: 16px; }

/* Honors sub-row */
.honors-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.honors-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.honors-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.honors-toggle span { font-size: .85rem; font-weight: 600; color: var(--text); }
.honors-badge-indicator {
  font-size: .68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 12px;
  background: #FEF3C7; color: #92400E;
  margin-left: 4px;
}
.honors-details {
  margin-top: 10px;
  display: none;
}
.honors-details.visible { display: block; }
.honors-info-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: .82rem;
  color: #78350F;
  margin-bottom: 10px;
  display: flex; gap: 8px; align-items: flex-start;
}
.honors-info-box a { color: #B45309; font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  border: none; transition: all .18s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary {
  background: var(--accent); color: var(--primary);
}
.btn-primary:hover { background: #74c870; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(140,216,136,.45); }
.btn-secondary {
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px;
}
.btn-row.end { justify-content: flex-end; }
.btn-row.center { justify-content: center; }
.btn-row.between { justify-content: space-between; }

.add-college-btn {
  background: none;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  width: 100%; padding: 12px;
  cursor: pointer; color: var(--text-muted);
  font: inherit; font-size: .9rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .18s;
  margin-top: 12px;
}
.add-college-btn:hover {
  border-color: var(--accent); color: var(--primary);
  background: #e8f5e8;
}
.add-college-btn svg { width: 18px; height: 18px; }

/* ── Section Header ──────────────────────────────────────── */
.section-header {
  margin-bottom: 28px;
}
.section-header h2 {
  margin-bottom: 4px;
}
.section-header p {
  color: var(--text-muted); font-size: .9rem;
}

/* ── Theme Chips ─────────────────────────────────────────── */
.theme-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.theme-chip {
  padding: 3px 10px;
  border-radius: 14px;
  font-size: .72rem; font-weight: 600;
  color: #fff;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ── College Result Cards ────────────────────────────────── */
.results-list { display: flex; flex-direction: column; gap: 24px; }

.college-result-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.college-result-header {
  padding: 18px 22px;
  background: linear-gradient(135deg, #f4f6fc 0%, #e8f5e8 100%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.college-result-name { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.college-result-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px;
}
.college-meta-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
  background: var(--surface2); color: var(--text-muted);
}
.college-meta-tag.platform { background: #e8f5e8; color: #1B4D1A; }
.college-meta-tag.honors { background: #FEF3C7; color: #92400E; }
.college-meta-tag.category { background: #F0FDF4; color: #166534; }
.college-major { font-size: .85rem; color: var(--text-muted); font-style: italic; }

.college-result-body { padding: 22px; }

.prompt-list { display: flex; flex-direction: column; gap: 14px; }
.prompt-item {
  padding: 14px 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
.prompt-item.commonapp { border-left-color: #374151; }
.prompt-item.honors { border-left-color: #B45309; background: #FFFBEB; }
.prompt-num {
  font-size: .7rem; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 5px;
}
.prompt-text { font-size: .875rem; color: var(--text); line-height: 1.55; }
.prompt-word-limit {
  font-size: .7rem; color: var(--text-muted);
  margin-top: 4px;
}
.prompt-themes { margin-top: 8px; }

.honors-program-section {
  margin-top: 18px;
  padding: 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
}
.honors-section-title {
  font-size: .8rem; font-weight: 700;
  color: #92400E; text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.honors-section-title svg { width: 14px; height: 14px; }
.honors-link { color: #B45309; font-weight: 600; font-size: .82rem; text-decoration: underline; }

.no-supplements {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: .875rem;
  font-style: italic;
}

/* ── Brainstorm Section ──────────────────────────────────── */
.brainstorm-card {
  background: linear-gradient(135deg, #f4f6fc 0%, #e8f5e8 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}
.brainstorm-card h3 { margin-bottom: 10px; }

.resume-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--surface);
}
.resume-drop-zone:hover,
.resume-drop-zone.dragover {
  border-color: var(--accent);
  background: #e8f5e8;
}
.resume-drop-zone svg {
  width: 36px; height: 36px; margin-bottom: 10px;
  color: var(--text-muted);
}
.resume-drop-zone p { color: var(--text-muted); font-size: .9rem; }
.resume-drop-zone strong { color: var(--primary); cursor: pointer; }
#resumeFileInput { display: none; }

.resume-preview {
  background: var(--surface);
  border: 1.5px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .875rem;
}
.resume-preview svg { width: 20px; height: 20px; color: var(--success); }
.resume-name { font-weight: 600; }
.resume-preview .btn-remove-college { color: var(--danger); }

.brainstorm-section {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}
.brainstorm-section-header {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.brainstorm-section-header:hover { background: var(--surface2); }
.brainstorm-section-title { font-weight: 700; font-size: .95rem; }
.brainstorm-section-body { padding: 18px; display: none; }
.brainstorm-section-body.open { display: block; }

.brainstorm-tip {
  padding: 10px 14px;
  background: #F0FDF4;
  border-left: 3px solid var(--success);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .82rem;
  color: #166534;
  margin-bottom: 10px;
}

/* ── Export Page ─────────────────────────────────────────── */
.export-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}
@media (max-width: 580px) { .export-options { grid-template-columns: 1fr; } }

.export-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.export-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.export-card svg {
  width: 36px; height: 36px;
  color: var(--primary); margin-bottom: 12px;
}
.export-card h4 { margin-bottom: 6px; }
.export-card p { font-size: .82rem; color: var(--text-muted); }

/* ── Common App Notice ───────────────────────────────────── */
.commonapp-notice {
  background: #e8f5e8;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.commonapp-notice h3 {
  color: var(--primary); font-size: .95rem; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.commonapp-prompt-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.commonapp-prompt-row:last-child { border-bottom: none; }
.commonapp-prompt-num {
  width: 22px; height: 22px; background: var(--primary); color: #fff;
  border-radius: 50%; font-size: .72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.commonapp-prompt-text { flex: 1; color: var(--text); line-height: 1.5; }
.commonapp-prompt-themes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

/* ── Alert / Notice Boxes ─────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: #e8f5e8; color: #1B4D1A; border: 1px solid var(--accent); }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(140,216,136,.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 60px;
  flex-direction: column; gap: 16px;
  color: var(--text-muted);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none; border-top: 1px solid var(--border); margin: 24px 0;
}
.divider-label {
  text-align: center; position: relative; margin: 20px 0;
}
.divider-label::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.divider-label span {
  position: relative; background: var(--bg);
  padding: 0 14px; font-size: .78rem;
  font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em;
}

/* ── Accordion ───────────────────────────────────────────── */
.accordion-toggle {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.accordion-icon { transition: transform .2s; color: var(--text-muted); }
.accordion-icon.open { transform: rotate(180deg); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px; height: 48px; margin-bottom: 14px;
  opacity: .4;
}
.empty-state h3 { margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: .875rem; }

/* ── Cycle Badge ─────────────────────────────────────────── */
.cycle-badge {
  display: inline-block;
  padding: 2px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
  background: var(--primary-light); color: var(--primary);
  letter-spacing: .04em;
}

/* ── Student Header Row (results page) ─────────────────── */
.student-header {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
}
.student-header-name { font-size: 1.2rem; font-weight: 700; }
.student-header-meta { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.student-header-actions { display: flex; gap: 10px; }

/* ── Site Footer ─────────────────────────────────────────── */
.site-footer {
  background: var(--primary);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 24px 0;
  margin-top: 48px;
  text-align: center;
}
.footer-disclosure {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.75);
  font-size: .82rem;
  line-height: 1.5;
  max-width: 680px;
  margin: 0 auto 10px;
}
.footer-disclosure svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent);
}
.footer-disclosure strong {
  color: #fff;
}
.footer-copyright {
  color: rgba(255,255,255,.45);
  font-size: .75rem;
  letter-spacing: .02em;
}

/* ── Print / PDF styles ──────────────────────────────────── */
@media print {
  .site-header, .steps-bar, .btn-row, .export-options,
  .no-print { display: none !important; }
  .page { display: block !important; }
  body { background: #fff; font-size: 12pt; }
  .card, .college-result-card { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  .card { padding: 20px; }
  .college-result-header { flex-direction: column; }
  .student-header { flex-direction: column; align-items: flex-start; }
  .steps-list { flex-wrap: wrap; gap: 4px; }
  .step-item { font-size: .72rem; padding: 4px 10px; }
  .step-item span { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .college-result-body { padding: 16px; }
}
