/* ============================================================
   Signup Genius — Public Stylesheet
   Fonts: Playfair Display (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* --- Variables -------------------------------------------- */
:root {
  --blue:        #1A5C96;
  --blue-dark:   #134878;
  --blue-mid:    #2471B3;
  --blue-light:  #EBF4FB;
  --gold:        #D4860A;
  --gold-light:  #FDF3E3;
  --teal:        #13827A;
  --teal-light:  #E5F6F5;
  --green:       #1E8A4C;
  --green-light: #E7F7EE;
  --red:         #C0392B;
  --red-light:   #FDECEA;

  --text-h:      #12263A;
  --text-body:   #374151;
  --text-muted:  #6B7280;
  --border:      #D1DCE8;
  --bg:          #F4F8FC;
  --white:       #FFFFFF;

  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(26,92,150,.10);
  --shadow-md:   0 6px 24px rgba(26,92,150,.14);
  --shadow-lg:   0 12px 40px rgba(26,92,150,.18);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --transition:   .2s ease;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button, input, select, textarea { font-family: inherit; }

/* --- Layout ----------------------------------------------- */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* --- Header ----------------------------------------------- */
.site-header {
  background: var(--blue-dark);
  background: linear-gradient(135deg, #0F3A61 0%, #1A5C96 60%, #2471B3 100%);
  color: var(--white);
  padding: 20px 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.site-header .container {
  display: flex; align-items: center; gap: 20px;
}
.site-header .logo {
  display: flex; align-items: center; gap: 12px; color: var(--white);
}
.site-header .logo-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
}
.site-header .logo-text { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; }
.site-header .logo-sub { font-size: .78rem; opacity: .75; letter-spacing: .04em; }
.header-nav { margin-left: auto; }
.header-nav a {
  color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 500;
  padding: 6px 14px; border-radius: 6px; transition: background var(--transition);
}
.header-nav a:hover { background: rgba(255,255,255,.12); color: var(--white); }

/* --- Hero ------------------------------------------------- */
.hero {
  background: linear-gradient(160deg, #0F3A61 0%, #1A5C96 100%);
  color: var(--white);
  padding: 64px 0 80px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 { font-family: var(--font-display); font-size: clamp(2rem,5vw,3rem); font-weight: 700; margin-bottom: 14px; position: relative; }
.hero p { font-size: 1.1rem; opacity: .85; max-width: 540px; margin: 0 auto; position: relative; }

/* --- Section labels --------------------------------------- */
.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-h); font-weight: 600; margin-bottom: 8px;
}
.section-sub { color: var(--text-muted); font-size: .95rem; }

/* --- Project Cards --------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 36px;
}
.project-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  display: flex; flex-direction: column;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.project-card-img {
  height: 200px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
  position: relative; overflow: hidden;
}
.project-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.project-card:hover .project-card-img img { transform: scale(1.04); }
.project-card-img .no-photo {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5); gap: 8px; font-size: .9rem;
}
.project-card-img .no-photo .icon { font-size: 3rem; }
.project-card-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--gold); color: var(--white);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
}
.project-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.project-card-body h3 {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
  color: var(--text-h); margin-bottom: 8px; line-height: 1.3;
}
.project-card-meta { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }
.project-card-meta span { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; }
.project-card-desc {
  font-size: .88rem; color: var(--text-muted);
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  margin-bottom: 16px; flex: 1;
}
.project-card-footer { border-top: 1px solid var(--border); padding-top: 14px; margin-top: auto; }
.project-card-slots {
  display: flex; align-items: center; justify-content: space-between;
}
.slots-info { font-size: .82rem; color: var(--text-muted); }
.slots-count { font-size: 1.05rem; font-weight: 600; color: var(--blue); }

/* --- Buttons --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: 8px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition); white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,92,150,.3); }
.btn-gold { background: var(--gold); color: var(--white); }
.btn-gold:hover { background: #B8720A; color: var(--white); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost { background: rgba(255,255,255,.12); color: var(--white); border: 1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.22); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* --- Project Detail Page --------------------------------- */
.project-detail-hero {
  background: linear-gradient(160deg, #0F3A61 0%, #1A5C96 100%);
  color: var(--white);
  padding: 0;
  position: relative; overflow: hidden;
}
.project-detail-hero .hero-img {
  height: 340px; position: relative;
}
.project-detail-hero .hero-img img {
  width: 100%; height: 100%; object-fit: cover; opacity: .55;
}
.project-detail-hero .hero-img .hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,40,70,.9) 30%, rgba(12,40,70,.4) 100%);
}
.project-detail-hero .hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px 0;
}
.project-detail-hero .no-photo-hero {
  height: 200px;
  background: linear-gradient(160deg, #0F3A61, #1A5C96);
  position: relative;
}
.project-detail-hero .no-photo-hero .hero-content {
  position: static; padding: 32px 0 24px;
}
.project-detail-hero h1 {
  font-family: var(--font-display); font-size: clamp(1.6rem,4vw,2.5rem);
  font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.project-back { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.8); font-size: .88rem; margin-bottom: 12px; }
.project-back:hover { color: var(--white); }

/* --- Slot Section --------------------------------------- */
.slots-section { padding: 48px 0; }
.slots-date-group { margin-bottom: 36px; }
.slots-date-heading {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.date-badge {
  background: var(--blue);
  color: var(--white);
  border-radius: 10px;
  padding: 8px 14px;
  text-align: center; line-height: 1.2; min-width: 64px;
}
.date-badge .day-num { font-size: 1.5rem; font-weight: 700; display: block; }
.date-badge .day-mon { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.date-weekday { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-h); font-weight: 600; }
.date-full { font-size: .85rem; color: var(--text-muted); }

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.slot-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: all var(--transition);
  position: relative;
}
.slot-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.slot-card.is-full { opacity: .65; }
.slot-time {
  font-size: 1.1rem; font-weight: 700; color: var(--text-h); margin-bottom: 6px;
}
.slot-time-range { font-size: .85rem; color: var(--text-muted); margin-bottom: 12px; }
.slot-progress-wrap { margin-bottom: 14px; }
.slot-progress-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .78rem; color: var(--text-muted); margin-bottom: 5px;
}
.slot-progress-label .count { font-weight: 600; color: var(--text-body); }
.slot-progress-bar { height: 6px; background: #E5ECF3; border-radius: 3px; overflow: hidden; }
.slot-progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-mid));
  transition: width .5s ease;
}
.slot-progress-fill.over-min { background: linear-gradient(90deg, var(--green), #25A55E); }
.slot-progress-fill.full { background: var(--text-muted); }
.slot-notes { font-size: .8rem; color: var(--text-muted); margin-bottom: 14px; font-style: italic; }
.slot-status-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 12px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.slot-status-badge.open { background: var(--green-light); color: var(--green); }
.slot-status-badge.needed { background: #FFF8E5; color: #A0640A; }
.slot-status-badge.full { background: #F0F0F0; color: #777; }

/* --- Info Card ------------------------------------------ */
.info-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin-bottom: 28px;
}
.info-card h3 {
  font-family: var(--font-display); font-size: 1.15rem;
  color: var(--text-h); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.info-card-body { font-size: .9rem; color: var(--text-body); white-space: pre-line; line-height: 1.8; }

/* --- Signup Modal --------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,25,45,.55);
  backdrop-filter: blur(3px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  transform: scale(.95) translateY(16px);
  transition: transform var(--transition);
  overflow: hidden;
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  background: linear-gradient(135deg, #0F3A61, #1A5C96);
  color: var(--white); padding: 20px 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.modal-header h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.modal-header .slot-detail { font-size: .83rem; opacity: .8; margin-top: 2px; }
.modal-close {
  background: rgba(255,255,255,.12); border: none;
  color: var(--white); width: 30px; height: 30px;
  border-radius: 6px; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; flex-shrink: 0;
  transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,.25); }
.modal-body { padding: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--text-h); margin-bottom: 5px;
}
.form-group label .req { color: var(--red); }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9rem; color: var(--text-body);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-control:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,92,150,.1);
}
.form-control.error { border-color: var(--red); }
.form-hint { font-size: .77rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--red); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.modal-footer {
  padding: 0 24px 24px;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* --- Success Screen ------------------------------------- */
.signup-success {
  text-align: center; padding: 32px 24px;
}
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--green-light); color: var(--green);
  display: grid; place-items: center;
  font-size: 2rem; margin: 0 auto 16px;
}
.signup-success h3 { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-h); margin-bottom: 8px; }
.signup-success p { color: var(--text-muted); font-size: .9rem; }

/* --- Alert Banner --------------------------------------- */
.alert {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-info { background: var(--blue-light); color: var(--blue-dark); border-left: 4px solid var(--blue); }
.alert-gold { background: var(--gold-light); color: #7A4800; border-left: 4px solid var(--gold); }

/* --- Footer --------------------------------------------- */
.site-footer {
  background: var(--text-h); color: rgba(255,255,255,.55);
  text-align: center; padding: 24px;
  font-size: .82rem; margin-top: 64px;
}
.site-footer a { color: rgba(255,255,255,.7); }

/* --- Loading spinner ------------------------------------ */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Skeleton ------------------------------------------ */
.skeleton { background: linear-gradient(90deg, #E8EFF5 25%, #F4F8FC 50%, #E8EFF5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Responsive ---------------------------------------- */
@media (max-width: 640px) {
  .hero { padding: 40px 0 56px; }
  .form-row { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .slots-grid { grid-template-columns: 1fr; }
  .site-header .logo-sub { display: none; }
}
