/* ===============================
   Global Styles & Variables
   =============================== */

:root {
  --primary-blue: #1e88e5;
  --primary-blue-dark: #1565c0;
  --accent-blue: #42a5f5;
  --light-grey: #f5f7fb;
  --border-grey: #dfe3eb;
  --text-main: #333333;
  --text-muted: #777777;
  --danger-red: #d32f2f;
  --success-green: #2e7d32;
  --card-radius: 10px;
  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.08);
  --transition-fast: 0.2s ease-in-out;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Reset-ish basics */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  color: var(--text-main);
  background-color: #ffffff;
}

/* ===============================
   Background & Layout
   =============================== */

body.bg {
  background: linear-gradient(135deg, #f8fbff 0%, #e9f3ff 40%, #f7fbff 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;           /* let containers handle padding */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* A simple centered container for landing pages if needed */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ===============================
   Top Bar / Header (optional)
   =============================== */

.top-bar {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--border-grey);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar .logo {
  font-weight: 700;
  color: var(--primary-blue);
  letter-spacing: 0.04em;
}

.top-bar nav a {
  margin-left: 20px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.top-bar nav a:hover {
  color: var(--primary-blue);
}

/* ===============================
   Card Layout
   =============================== */

.card {
  background: #ffffff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

.card.wide {
  max-width: 900px;
}

.card h1,
.card h2,
.card h3 {
  margin-top: 0;
  color: #1f2933;
}

.card h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 1.15rem;
  margin-top: 20px;
}

/* Card grid if you need multiple small cards (e.g., admin dashboard) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* ===============================
   Typography Helpers
   =============================== */

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.text-center {
  text-align: center;
}

/* ===============================
   Form Elements
   =============================== */

form {
  margin-top: 10px;
}

.field-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-size: 0.92rem;
  color: #4b5563;
  margin-bottom: 4px;
}

.field-group small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.field-group input[type="text"],
.field-group input[type="tel"],
.field-group input[type="email"],
.field-group input[type="password"],
.field-group input[type="date"],
.field-group input[type="number"],
.field-group textarea,
.field-group select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-grey);
  font-size: 0.95rem;
  outline: none;
  background-color: #f9fafb;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.field-group textarea {
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: var(--primary-blue);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(30, 136, 229, 0.2);
}

/* Inline input: e.g., mobile + button for OTP */
.inline-input {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-input input {
  flex: 1;
}

.inline-input button {
  white-space: nowrap;
}

/* ===============================
   Buttons
   =============================== */

button,
.btn-primary,
.btn-secondary {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  font-weight: 500;
}

.btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(30, 136, 229, 0.3);
}

.btn-primary:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(21, 101, 192, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(21, 101, 192, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--primary-blue);
  border: 1px solid var(--primary-blue);
}

.btn-secondary:hover {
  background: var(--primary-blue);
  color: #ffffff;
}

/* Make button-like links look consistent */
a.btn-primary,
a.btn-secondary {
  display: inline-block;
  text-decoration: none;
}

/* ===============================
   Alerts (Messages)
   =============================== */

.alert {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.alert-error {
  background: #fdecea;
  color: var(--danger-red);
  border: 1px solid #f5c2c0;
}

.alert-success {
  background: #edf7ed;
  color: var(--success-green);
  border: 1px solid #c8e6c9;
}

/* ===============================
   Tables (Admin listing, etc.)
   =============================== */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
}

table thead {
  background: #e3f2fd;
}

table th,
table td {
  padding: 8px 10px;
  border: 1px solid var(--border-grey);
  text-align: left;
}

table th {
  font-weight: 600;
  color: #1f2933;
}

table tbody tr:nth-child(even) {
  background: #f9fafb;
}

table tbody tr:hover {
  background: #e8f0fe;
}

/* ===============================
   Sections inside cards
   =============================== */

.section {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed #e0e0e0;
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ===============================
   Layout Helpers for Education & Job Rows
   (Step 2 & Step 3 screens)
   =============================== */

/* We already used .edu-row and .job-row inline, but this ensures
   they look good even if inline styles are removed later. */

.edu-row,
.job-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border-grey);
  padding: 10px;
  border-radius: 6px;
  background: #f9fafc;
}

.edu-row .field-group,
.job-row .field-group {
  flex: 1 1 180px;
  min-width: 150px;
}

/* ===============================
   Badges & Tags (optional use)
   =============================== */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border-grey);
  color: var(--text-muted);
  background: #f5f7fb;
}

.badge-primary {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: #e3f2fd;
}

/* ===============================
   Responsive Tweaks
   =============================== */

@media (max-width: 768px) {
  body.bg {
    padding: 20px 10px;
    align-items: stretch;
  }

  .card,
  .card.wide {
    padding: 16px;
    max-width: 100%;
  }

  .inline-input {
    flex-direction: column;
  }
}

/* ========== Layout shell: header & footer ========== */

.app-header {
  background: var(--card-bg, #ffffff);
  border-bottom: 1px solid var(--border-grey, #e5e7eb);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  padding: 8px 16px;
  margin-bottom: 16px;
}

.app-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e5f2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #d0e2ff;
}

.app-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-brand-initials {
  font-weight: 700;
  color: #1b63d6;
  font-size: 1.1rem;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
}

.app-brand-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: #111827;
}

.app-brand-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.app-header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.app-header-nav a {
  text-decoration: none;
  color: #1f2933;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.app-header-nav a:hover {
  background: #e5f0ff;
  border-color: #c3d3ff;
}

/* Footer */

.app-footer {
  margin-top: 32px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-grey, #e5e7eb);
  background: #f9fafb;
}

.app-footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
}

.app-footer a {
  color: #1b63d6;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

/* Slightly narrower content wrapper (optional) */
.page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

/* Responsive tweaks for small screens */
@media (max-width: 640px) {
  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .app-header-nav {
    align-self: stretch;
    justify-content: flex-start;
  }
}

/* ===============================
   Home page hero & sections
   =============================== */

.hero-section {
  margin-top: 8px;
  margin-bottom: 24px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
  gap: 20px;
  align-items: stretch;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  font-weight: 600;
}

.hero-title {
  font-size: 1.6rem;
  margin: 0;
  color: var(--primary-blue-dark);
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.hero-side {
  display: flex;
  align-items: stretch;
}

.hero-side-card {
  background: #f5f7fb;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-grey);
  padding: 14px 16px;
  font-size: 0.92rem;
}

.hero-side-card h2 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.1rem;
  color: var(--primary-blue-dark);
}

.hero-side-card ul {
  padding-left: 18px;
  margin: 0;
}

/* Section subtitles */
.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 4px 0 14px;
}

/* Steps row under "How it works" */
.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.step-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border-grey);
  padding: 12px 12px 14px;
  display: flex;
  gap: 10px;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e3f2fd;
  color: var(--primary-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.step-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Bottom two-column section */
.hero-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 16px;
}

/* Responsive tweaks for home page */
@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.4rem;
  }

  .hero-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
