/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 30%, #ecfdf5 60%);
  min-height: 100vh; color: #0f172a;
}

/* ===== SHARED INPUTS & BUTTONS ===== */
.input {
  width: 100%; padding: 12px 14px; border: 2px solid #e2e8f0;
  border-radius: 12px; font-size: 14px; outline: none; font-family: inherit; box-sizing: border-box;
  background: #fff; transition: border-color 0.2s;
}
.input:focus { border-color: #6366f1; }
.input-sm {
  padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 12px; outline: none; font-family: inherit;
}
.input-sm:focus { border-color: #6366f1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.btn.primary {
  width: 100%; background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.btn.primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: #f1f5f9; color: #0f172a; }
.btn.ghost { background: #f1f5f9; color: #334155; font-size: 16px; font-weight: 600; }
.btn.ghost:hover { background: #e2e8f0; }
.btn-lg { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm {
  padding: 6px 14px; border: none; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.btn-sm.manage { background: #f1f5f9; color: #0f172a; }
.btn-sm.manage:hover { background: #e2e8f0; }
.btn-sm.copy { background: #eef2ff; color: #4338ca; }
.btn-sm.copy:hover { background: #e0e7ff; }
.btn-sm.save { background: #6366f1; color: #fff; }
.btn-sm.save:hover { background: #4f46e5; }
.btn-sm.cancel { background: #f1f5f9; color: #64748b; }
.btn-sm.cancel:hover { background: #e2e8f0; }
.btn-sm.edit { background: #eef2ff; color: #4338ca; }
.btn-sm.edit:hover { background: #e0e7ff; }
.btn-sm.cancel-book { background: #fef3c7; color: #92400e; }
.btn-sm.cancel-book:hover { background: #fde68a; }
.btn-sm.del { background: #fee2e2; color: #dc2626; }
.btn-sm.del:hover { background: #fecaca; }

.error-banner {
  background: #fef2f2; color: #ef4444; padding: 10px 14px;
  border-radius: 10px; font-size: 14px; margin-bottom: 16px;
  border: 1px solid #fecaca; font-weight: 500;
}

/* ===== SHARED STATES ===== */
.state-box { text-align: center; padding: 40px 20px; }
.state-box h2 { font-size: 22px; color: #0f172a; margin: 16px 0 8px; }
.state-box p { color: #64748b; font-size: 14px; }
.spinner {
  width: 40px; height: 40px; border: 3px solid #e2e8f0;
  border-top-color: #6366f1; border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fee2e2; color: #ef4444; font-size: 32px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.check-circle {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 50%; background: linear-gradient(135deg, #10b981, #059669);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(16,185,129,0.25);
}

.back-link {
  background: none; border: none; color: #6366f1; font-size: 13px;
  font-weight: 600; cursor: pointer; padding: 0 0 12px; font-family: inherit;
}
.back-link:hover { color: #4f46e5; }

.gate-card {
  background: #fff; border-radius: 24px; padding: 40px 36px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.08); text-align: center;
  max-width: 420px; margin: 0 auto;
}
.gate-card h1 { font-size: 24px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.gate-card .mentor { font-size: 14px; color: #64748b; }
.gate-card .date-info { font-size: 14px; color: #6366f1; font-weight: 600; margin-bottom: 20px; }
.gate-card label { display: block; font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 6px; text-align: left; }
.gate-card .input { margin-bottom: 12px; }

.sub { font-size: 14px; color: #64748b; margin-bottom: 28px; }

/* ===== HOMEPAGE ===== */
.home { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; }
.gate-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.container { max-width: 480px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.card {
  background: #fff; border-radius: 24px; padding: 40px 36px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.08); text-align: center;
}
.home-logo {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 16px; background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 28px;
}
h1 { font-size: 24px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }

.list-card {
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.05);
}
.list-card h2 { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 16px; }

.session-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid #f1f5f9; gap: 12px;
}
.session-row:last-child { border-bottom: none; }
.session-info { flex: 1; cursor: pointer; min-width: 0; }
.session-info:hover .session-title { color: #6366f1; }
.session-title {
  display: block; font-size: 15px; font-weight: 700; color: #0f172a;
  margin-bottom: 3px; transition: color 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-meta { font-size: 12px; color: #94a3b8; }
.session-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== CREATEPAGE ===== */
.create-page {
  min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
}
.create-card {
  background: #fff; border-radius: 24px; padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08); max-width: 520px; width: 100%;
}
.create-card h1 { font-size: 20px; font-weight: 800; }
.create-card label { display: block; font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 6px; margin-top: 16px; }
.create-card .input { margin-bottom: 4px; }

.inline-fields { display: flex; gap: 12px; }
.inline-field { flex: 1; }
.inline-field label { margin-top: 16px; }

.preview-box {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 14px; padding: 16px; margin-top: 16px; margin-bottom: 16px;
}
.preview-box h3 { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.preview-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 200px; overflow-y: auto; margin-bottom: 8px;
}
.preview-tag {
  display: inline-block; padding: 4px 10px; font-size: 12px; font-weight: 600;
  background: rgba(99,102,241,0.06); color: #6366f1;
  border: 1px solid rgba(99,102,241,0.1); border-radius: 8px;
}
.preview-end { font-size: 13px; font-weight: 700; color: #10b981; margin-bottom: 4px; }
.preview-tip { font-size: 11px; color: #94a3b8; }

.create-success { text-align: center; max-width: 520px; width: 100%; }
.create-success h2 { font-size: 20px; font-weight: 800; margin: 12px 0 4px; }
.success-sub { font-size: 14px; color: #64748b; margin-bottom: 24px; }

.share-box {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 14px; padding: 16px; margin-bottom: 20px; text-align: left;
}
.share-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
}
.share-row + .share-row { border-top: 1px solid #e2e8f0; }
.share-label { font-size: 12px; font-weight: 600; color: #64748b; flex-shrink: 0; min-width: 56px; }
.share-value { font-size: 12px; color: #0f172a; font-weight: 600; flex: 1; word-break: break-all; font-family: 'SF Mono', 'Menlo', monospace; }
.share-tip { font-size: 13px; color: #94a3b8; margin-bottom: 20px; }
.create-success .btn { margin-bottom: 12px; }

/* ===== BOOKINGPAGE ===== */
.booking-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.unlocked-view { width: 100%; max-width: 520px; }
.unlocked-card {
  background: #fff; border-radius: 20px; padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.header h1 { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 2px; }
.header .mentor { font-size: 13px; color: #64748b; }
.name-section { margin-bottom: 20px; }
.name-section label { display: block; font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }

.slots-section { margin-bottom: 20px; }
.slots-section h3 { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 12px; }
.date-group { margin-bottom: 14px; }
.date-header {
  font-size: 13px; font-weight: 700; color: #6366f1;
  padding: 4px 10px; background: rgba(99,102,241,0.06);
  border-radius: 8px; margin-bottom: 8px;
}
.slot-list { display: flex; flex-direction: column; gap: 6px; }
.slot-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 12px;
  background: #fff; cursor: pointer; transition: all 0.2s;
  font-family: inherit; font-size: 14px; text-align: left;
}
.slot-btn.open:hover { border-color: #6366f1; background: rgba(99,102,241,0.02); }
.slot-btn.booked { opacity: 0.5; cursor: not-allowed; background: #f8fafc; }
.slot-btn:disabled { cursor: not-allowed; }
.slot-time { font-weight: 700; color: #0f172a; }
.slot-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 100px; }
.slot-status.available { background: rgba(16,185,129,0.1); color: #10b981; }
.slot-status:not(.available) { background: rgba(148,163,184,0.15); color: #64748b; }

.confirm-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,0.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.confirm-dialog {
  background: #fff; border-radius: 20px; padding: 32px 28px;
  max-width: 380px; width: 100%; box-shadow: 0 25px 60px rgba(0,0,0,0.15);
  animation: fadeInUp 0.25s;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.confirm-dialog h3 { font-size: 18px; font-weight: 800; color: #0f172a; margin-bottom: 20px; text-align: center; }
.confirm-info { background: #f8fafc; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.confirm-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.confirm-row + .confirm-row { border-top: 1px solid #e2e8f0; }
.confirm-label { font-size: 13px; color: #64748b; font-weight: 500; }
.confirm-value { font-size: 14px; color: #0f172a; font-weight: 700; }
.confirm-note { font-size: 12px; color: #94a3b8; text-align: center; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 12px; }
.confirm-actions .btn { flex: 1; }

/* ===== MANAGEPAGE ===== */
.manage-page {
  min-height: 100vh; display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px;
}
.manage-view { width: 100%; max-width: 600px; }
.manage-card {
  background: #fff; border-radius: 20px; padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.manage-card .header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.manage-card .header h1 { font-size: 20px; font-weight: 800; }
.manage-card .header .mentor { font-size: 13px; color: #64748b; }
.stat { font-size: 14px; font-weight: 700; color: #6366f1; white-space: nowrap; }

.info-box { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.password-box { background: #fffbeb; border: 1px solid #fde68a; }
.link-box { background: #eef2ff; border: 1px solid #c7d2fe; }
.info-label { font-weight: 600; color: #64748b; flex-shrink: 0; }
.info-value { font-size: 12px; font-weight: 600; flex: 1; word-break: break-all; font-family: 'SF Mono', 'Menlo', monospace; }
.password-box .info-value { color: #92400e; }
.link-box .info-value { color: #4338ca; }

.slot-table { margin-top: 20px; margin-bottom: 16px; }
.table-header {
  display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 8px;
  padding: 8px 0; border-bottom: 2px solid #e2e8f0;
  font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase;
}
.table-row {
  display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.table-row.booked { background: rgba(99,102,241,0.02); }
.cell-time { font-weight: 600; color: #0f172a; }
.cell-status { font-size: 12px; }
.booked-name { color: #10b981; font-weight: 600; }
.open-text { color: #94a3b8; }
.cell-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.meeting-link { font-size: 11px; color: #6366f1; font-weight: 600; text-decoration: none; }
.meeting-link:hover { text-decoration: underline; }

.edit-row { display: flex; gap: 6px; align-items: center; grid-column: 1 / -1; flex-wrap: wrap; }

.add-section { margin-bottom: 24px; }
.btn-add {
  width: 100%; padding: 12px; border: 2px dashed #e2e8f0; border-radius: 12px;
  background: none; font-size: 14px; font-weight: 700; color: #6366f1;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-add:hover { border-color: #6366f1; background: rgba(99,102,241,0.02); }
.add-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.danger-zone {
  border-top: 2px solid #fee2e2; padding-top: 24px; text-align: center;
}
.btn-del-outline {
  padding: 10px 24px; border: 2px solid #fca5a5; border-radius: 12px;
  background: none; color: #ef4444; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-del-outline:hover { background: #fef2f2; }
.btn-del-solid {
  padding: 10px 24px; border: none; border-radius: 12px;
  background: #ef4444; color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-del-solid:hover { background: #dc2626; }
.btn-del-solid:disabled { opacity: 0.5; cursor: not-allowed; }
.danger-warn { font-size: 13px; color: #dc2626; font-weight: 600; margin-bottom: 12px; }

/* ===== BOOKINGSUCCESSPAGE ===== */
.success-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 24px;
}
.success-card {
  background: #fff; border-radius: 24px; padding: 40px 32px 28px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
}
.card-header { margin-bottom: 28px; }
.card-header h1 { font-size: 24px; font-weight: 800; color: #0f172a; letter-spacing: -0.3px; margin-bottom: 6px; }
.subtitle { font-size: 13px; color: #94a3b8; }

.info-card {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 14px; padding: 18px 16px; text-align: left;
}
.info-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; }
.info-sep { height: 1px; background: #e2e8f0; margin: 4px 0; }
.label { font-size: 13px; color: #64748b; font-weight: 500; flex-shrink: 0; }
.value { font-size: 14px; color: #0f172a; font-weight: 600; text-align: right; }
.name-value { color: #6366f1; }
.time-item { align-items: flex-start; }
.time-block { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.time-date { font-size: 13px; color: #64748b; font-weight: 500; }
.time-range { font-size: 22px; font-weight: 800; color: #6366f1; letter-spacing: -0.3px; line-height: 1; }

.meeting-box {
  margin-top: 16px; padding: 12px; background: #eef2ff;
  border: 1px solid #c7d2fe; border-radius: 10px; text-align: center;
}
.meeting-label { display: block; font-size: 12px; font-weight: 700; color: #4338ca; margin-bottom: 6px; }
.meeting-link {
  font-size: 12px; font-weight: 600; color: #4f46e5; word-break: break-all;
  font-family: 'SF Mono', 'Menlo', monospace;
}
.card-footer { margin-top: 24px; font-size: 11px; color: #cbd5e1; letter-spacing: 0.5px; }

.actions { max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.btn-save {
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(16,185,129,0.35); }
.btn-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-done {
  width: 100%; padding: 14px; border: none; border-radius: 14px;
  background: #f1f5f9; color: #334155; font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-done:hover { background: #e2e8f0; }
