* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2754ff;
  --primary-dark: #1233a3;
  --accent: #00a6ff;
  --green: #0fb981;
  --orange: #ff8a00;
  --danger: #ef4444;
  --text: #101828;
  --muted: #667085;
  --bg: #f6f8fc;
  --white: #ffffff;
  --soft: #eef5ff;
  --line: #e3e9f5;
  --shadow: 0 18px 44px rgba(39, 84, 255, 0.13);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 92px;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

/* Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 14px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.brand-box h3 {
  font-size: 16px;
  line-height: 1;
}

.brand-box p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.login-btn {
  border: none;
  background: var(--soft);
  color: var(--primary-dark);
  padding: 10px 15px;
  border-radius: 50px;
  font-weight: 900;
}

/* Referral */
.ref-strip {
  display: none;
  margin: 12px 15px 0;
  padding: 12px 14px;
  background: #eafaf3;
  color: #087148;
  border-radius: 16px;
  font-size: 14px;
  border: 1px solid #c8f0df;
}

/* Hero */
.page-hero {
  margin: 15px;
  padding: 22px 17px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, #dbeaff, transparent 34%),
    linear-gradient(135deg, #ffffff, #eef5ff);
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
}

.tagline {
  display: inline-block;
  background: var(--soft);
  color: var(--primary-dark);
  border-radius: 50px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.page-hero h1 {
  font-size: 34px;
  line-height: 1.05;
  margin: 12px 0 8px;
  letter-spacing: -1px;
}

.page-hero h1 span {
  color: var(--primary);
}

.page-hero p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* Layout */
.profile-section {
  padding: 10px 15px 26px;
  display: grid;
  gap: 15px;
}

.profile-summary,
.form-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 27px;
  padding: 16px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.05);
}

.profile-summary {
  height: fit-content;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.profile-summary h2 {
  font-size: 24px;
  margin-bottom: 5px;
}

.profile-summary p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.profile-stat {
  background: var(--soft);
  border-radius: 17px;
  padding: 11px;
}

.profile-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.profile-stat b {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.profile-row b {
  color: var(--text);
  text-align: right;
}

/* Form */
.profile-form {
  display: grid;
  gap: 14px;
}

.form-heading {
  margin-bottom: 12px;
}

.form-heading span {
  display: inline-block;
  background: var(--soft);
  color: var(--primary-dark);
  border-radius: 50px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-heading h2 {
  font-size: 23px;
  margin-top: 8px;
  letter-spacing: -0.5px;
}

.form-card label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin: 12px 0 6px;
}

.form-card input,
.form-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  outline: none;
  background: white;
}

.form-card textarea {
  min-height: 95px;
  resize: vertical;
}

.form-card input:focus,
.form-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(39, 84, 255, 0.09);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.danger-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}

/* Buttons */
.primary-btn,
.secondary-btn,
.outline-btn,
.danger-btn {
  border: none;
  border-radius: 16px;
  padding: 13px 17px;
  font-weight: 900;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow);
}

.secondary-btn {
  background: var(--soft);
  color: var(--primary-dark);
}

.outline-btn {
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-btn {
  background: #fff1f1;
  color: var(--danger);
}

.full-btn {
  width: 100%;
}

/* Same Bottom Nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 560px;
  z-index: 80;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 14px 35px rgba(16, 24, 40, 0.18);
  border-radius: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px;
}

.bottom-nav .nav-item {
  padding: 8px 4px;
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  display: grid;
  gap: 3px;
  place-items: center;
}

.bottom-nav .nav-item span {
  font-size: 17px;
  line-height: 1;
}

.bottom-nav .nav-item b {
  font-size: 10px;
  line-height: 1;
}

.bottom-nav .nav-item.active {
  background: var(--soft);
  color: var(--primary-dark);
}

/* Login Modal */
.login-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 18, 35, 0.55);
  padding: 15px;
  place-items: end center;
}

.login-modal.active {
  display: grid;
}

.login-box {
  position: relative;
  background: white;
  border-radius: 28px;
  padding: 22px;
  width: 100%;
  max-width: 430px;
}

.close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 24px;
}

.login-box h2 {
  margin-bottom: 8px;
}

.login-box p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin: 12px 0 6px;
}

.login-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  outline: none;
}

.login-box small {
  color: var(--muted);
  display: block;
  margin: 8px 0;
}

.otp-area {
  display: none;
}

/* Desktop */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .main-header {
    padding: 18px 38px;
  }

  .ref-strip,
  .page-hero {
    margin-left: 38px;
    margin-right: 38px;
  }

  .page-hero {
    padding: 32px;
  }

  .page-hero h1 {
    font-size: 50px;
  }

  .profile-section {
    padding: 10px 38px 36px;
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }

  .profile-summary {
    position: sticky;
    top: 92px;
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .bottom-nav {
    display: none;
  }
}
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-card input[readonly] {
  background: #f8fafc;
  color: #667085;
  cursor: not-allowed;
}

.profile-summary .primary-btn {
  margin-top: 14px;
}

.profile-row b {
  max-width: 58%;
  word-break: break-word;
}

@media (max-width: 420px) {
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .profile-row {
    display: block;
  }

  .profile-row b {
    display: block;
    max-width: 100%;
    text-align: left;
    margin-top: 4px;
  }
}