:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #667085;
  --primary: #1250e6;
  --primary-dark: #0d46d0;
  --border: #e8eaf2;
  --shadow-soft: 0 6px 18px rgba(41, 47, 76, 0.06);
  --error-bg: #fef2f2;
  --error-text: #b42318;
  --success-bg: #ecfdf3;
  --success-text: #027a48;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
}

a,
button,
input {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

.profile-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  padding: 18px 16px 14px;
  background:
    radial-gradient(circle at top right, rgba(18, 80, 230, 0.16), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fd 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 14px;
}

.topbar__nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.topbar__nav .back-link {
  justify-self: start;
}

.topbar__nav .support-link {
  justify-self: end;
}

.brand--centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(18, 80, 230, 0.18);
  flex-shrink: 0;
}

.brand__name {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.title-strip {
  padding: 14px 16px;
  border-radius: 18px;
  background: #eceff3;
  border: 1px solid #dde3eb;
}

.title-strip h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.profile-main {
  padding: 18px 16px 124px;
  display: grid;
  gap: 18px;
}

.profile-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 28px;
}

.screen-message {
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
}

.screen-message--error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid rgba(180, 35, 24, 0.12);
}

.screen-message--success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(2, 122, 72, 0.12);
}

.profile-form {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.form-section {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fbfcff;
}

.form-section__title {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field__label {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-field__input {
  width: 100%;
  min-height: 58px;
  border: 1px solid #ccd5e3;
  border-radius: 18px;
  padding: 14px 16px;
  background: #fff;
  color: var(--text);
}

.form-field__input:focus {
  outline: none;
  border-color: rgba(18, 80, 230, 0.5);
  box-shadow: 0 0 0 4px rgba(18, 80, 230, 0.08);
}

.form-field__input--readonly {
  background: #f7f8fc;
  color: #667085;
}

.profile-form__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.btn-primary,
.btn-secondary {
  appearance: none;
  border-radius: 18px;
  min-width: 150px;
  min-height: 56px;
  padding: 0 24px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgba(18, 80, 230, 0.2);
}

.btn-secondary {
  border: 1px solid #d9dfeb;
  background: #fff;
  color: var(--primary-dark);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  background: rgba(35, 48, 70, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: 0 -10px 28px rgba(20, 24, 38, 0.18);
  z-index: 30;
}

.bottom-nav__item {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.82);
  min-height: 62px;
  border-radius: 18px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.bottom-nav__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.bottom-nav__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
}

.bottom-nav__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bottom-nav__label {
  font-size: 11px;
  line-height: 1;
}

.bottom-nav__menu-wrap {
  position: relative;
  display: flex;
  width: 100%;
}

.bottom-nav__menu-wrap .bottom-nav__item {
  width: 100%;
}

.bottom-nav__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(35, 48, 70, 0.98);
  box-shadow: 0 18px 38px rgba(20, 24, 38, 0.22);
  backdrop-filter: blur(16px);
}

.bottom-nav__menu[hidden] {
  display: none !important;
}

.bottom-nav__menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.bottom-nav__menu-item {
  appearance: none;
  display: block;
  border: none;
  width: 100%;
  text-align: left;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  padding: 14px 14px;
  font-weight: 700;
  cursor: pointer;
}

.bottom-nav__menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bottom-nav__menu-item--current {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  cursor: default;
}

.bottom-nav__menu-item--danger {
  color: #fecaca;
}

.bottom-nav__menu-item--danger:hover {
  background: rgba(185, 28, 28, 0.16);
}

@media (min-width: 768px) {
  .topbar,
  .profile-main {
    max-width: 980px;
    margin: 0 auto;
  }

  .profile-main {
    padding-top: 24px;
  }

}

@media (max-width: 640px) {
  .topbar__nav {
    grid-template-columns: auto 1fr auto;
  }

  .brand__name {
    font-size: 16px;
  }

  .title-strip h1 {
    font-size: 20px;
  }

  .section-header h2 {
    font-size: 24px;
  }

  .profile-form__actions {
    justify-content: stretch;
  }

  .btn-primary,
  .btn-secondary {
    min-width: 0;
    flex: 1;
  }
}
