
/* Modern consistency layer
   Keep this file additive: it standardizes spacing, cards, buttons, forms,
   navigation, and profile media without rewriting individual pages. */

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.86);
  --text: #182235;
  --muted: #64748b;
  --line: #e5eaf1;
  --brand: #1f8f5f;
  --brand-dark: #176f4a;
  --brand-light: #eaf8f1;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #15803d;
  --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.07);
  --shadow-card: 0 14px 34px rgba(15, 23, 42, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --focus-ring: 0 0 0 4px rgba(31, 143, 95, 0.16);
}

html {
  background: var(--bg);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 10% -10%, rgba(31, 143, 95, 0.09), transparent 32rem),
    radial-gradient(circle at 90% 0%, rgba(37, 99, 235, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container {
  width: min(100% - 32px, 1240px);
  padding-left: 0;
  padding-right: 0;
}

.site-header {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(226, 232, 240, 0.75);
}

.nav-wrap {
  min-height: 76px;
}

.brand-logo {
  height: 52px;
}

.main-nav {
  gap: 12px;
}

.main-nav a,
.nav-user-trigger {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  color: #263348;
  font-size: 15px;
  font-weight: 700;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.main-nav a:hover,
.nav-user-trigger:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}

.nav-join-btn,
.hero-btn-primary,
.btn-primary,
button[type="submit"],
input[type="submit"] {
  background: linear-gradient(135deg, var(--brand), #22a06b);
  color: #fff !important;
  border: 0;
  box-shadow: 0 12px 24px rgba(31, 143, 95, 0.20);
}

.nav-join-btn:hover,
.hero-btn-primary:hover,
.btn-primary:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  transform: translateY(-1px);
}

.nav-messages-link {
  position: relative;
  gap: 8px;
}

.nav-msg-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f472b6;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-user-dropdown {
  position: relative;
  display: inline-block;
}

.nav-user-trigger {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.nav-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 8px;
  display: none;
  z-index: 1000;
}

.nav-user-menu a {
  display: flex;
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
}

.nav-user-dropdown:hover .nav-user-menu,
.nav-user-dropdown:focus-within .nav-user-menu {
  display: block;
}

.site-main {
  padding-bottom: 56px;
}

.hero-grid,
.card,
.dashboard-card,
.tutor-card,
.auth-card,
.settings-card,
.profile-card,
.notice-card,
.admin-card,
form:not(.inline-form) {
  border: 1px solid rgba(226, 232, 240, 0.88);
  box-shadow: var(--shadow-soft);
}

.card,
.dashboard-card,
.tutor-card,
.auth-card,
.settings-card,
.profile-card,
.notice-card,
.admin-card {
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
}

.card,
.dashboard-card,
.tutor-card,
.auth-card,
.settings-card,
.profile-card,
.notice-card,
.admin-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tutor-card:hover,
.dashboard-card:hover,
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: rgba(31, 143, 95, 0.22);
}

h1, h2, h3 {
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

p {
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

button,
.btn,
.button,
.hero-btn,
input[type="submit"] {
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

img[src*="/uploads/"],
.profile-pic,
.profile-pic-large,
.tutor-mini-photo,
.admin-profile-image,
.tutor-card img {
  background: var(--brand-light);
  object-fit: cover;
}

.profile-pic,
.tutor-mini-photo {
  border: 4px solid #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.profile-pic-large {
  width: 148px;
  height: 148px;
  border-radius: 999px;
}

.tutor-mini-photo {
  width: 92px;
  height: 92px;
  border-radius: 999px;
}

.site-footer {
  background: #0f172a;
  color: #e2e8f0;
  border-top: 0;
}

.site-footer p,
.site-footer a {
  color: #cbd5e1;
}

.site-footer a:hover {
  color: #ffffff;
}

.flash {
  border: 1px solid transparent;
  font-weight: 700;
}

.flash.success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.flash.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.flash.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.flash.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

@media (max-width: 900px) {
  .nav-wrap {
    min-height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    align-items: flex-start;
  }

  .main-nav {
    justify-content: flex-end;
  }

  .main-nav a,
  .nav-user-trigger {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 14px;
  }

  .nav-user-menu {
    min-width: 180px;
  }

  .profile-pic-large {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1240px);
  }

  .nav-wrap {
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
  }
}


/* Second consistency pass: shared polish for deploy-ready UI */
.preview-banner {
  background: var(--danger);
  color: #fff;
  padding: 8px 12px;
  text-align: center;
  font-weight: 800;
  letter-spacing: .02em;
}

img {
  max-width: 100%;
}

.profile-pic,
.tutor-card-media img,
.tutor-mini-photo {
  background: linear-gradient(135deg, #eef7f2, #f8fafc);
  border: 1px solid rgba(226, 232, 240, 0.95);
  object-fit: cover;
}

.profile-pic {
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}

.profile-pic-large {
  width: 160px;
  height: 160px;
}

.tutor-card-refined {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tutor-card-refined:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  border-color: rgba(31, 143, 95, 0.18);
}

.tutor-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eef2f7;
}

.tutor-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform .28s ease;
}

.tutor-card-refined:hover .tutor-card-media img {
  transform: scale(1.035);
}

.tutor-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.tutor-card-head {
  align-items: flex-start;
}

.tutor-card-actions {
  margin-top: auto;
}

.badge,
.verified-pill,
.results-chip,
.trust-mini-card,
.next-available-chip {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.card,
.flash,
input,
select,
textarea,
button,
.btn {
  -webkit-font-smoothing: antialiased;
}

.detail-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) 1fr;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-value {
  color: var(--text);
  overflow-wrap: anywhere;
}

.site-footer {
  margin-top: 56px;
}

.footer-wrap {
  gap: 22px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--brand-dark);
}

@media (max-width: 760px) {
  .nav-wrap {
    min-height: auto;
    padding: 14px 0;
  }

  .main-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .main-nav a,
  .nav-user-trigger {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 14px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .profile-pic-large {
    width: 128px;
    height: 128px;
  }
}


/* Settings/profile refinement and safer upload UX */
.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.settings-hero h1 {
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.settings-section {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 6px;
}

.settings-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.media-upload-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px dashed rgba(31, 143, 95, .42);
  border-radius: var(--radius-md);
  background: rgba(234, 248, 241, .52);
}

.media-upload-preview .profile-pic,
.media-upload-panel .profile-pic {
  width: 108px;
  height: 108px;
}

.help-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.choice-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.choice-card input {
  width: auto;
  margin-top: 4px;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card small {
  color: var(--muted);
  margin-top: 2px;
}

.sticky-save-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 8px;
}

.settings-subcard {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .74);
}

.soft-divider {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.stacked-list {
  display: grid;
  gap: 12px;
}

.availability-row {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.error-page {
  max-width: 720px;
  margin: 48px auto;
  text-align: center;
  padding: 46px 28px;
}

.error-code {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 28px;
  font-weight: 950;
}

.error-page h1 {
  margin-bottom: 10px;
}

.error-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 760px) {
  .settings-hero,
  .section-heading {
    flex-direction: column;
  }

  .settings-pill {
    white-space: normal;
  }

  .media-upload-panel {
    grid-template-columns: 1fr;
  }

  .sticky-save-row {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-card);
  }
}
