/* =========================================================
   PITCH. / PROFILE SETTINGS
   ========================================================= */

.settings-page {
  min-height: calc(100vh - 160px);
  padding: 54px 0 80px;
  color: var(--color-text-primary);
}

.settings-hero {
  width: 100%;
}

.settings-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.settings-heading h1 {
  margin: 6px 0 8px;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1.4px;
}

.settings-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* =========================================================
   BACK BUTTON
   ========================================================= */

.settings-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;
  padding: 0 16px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  background: rgba(255, 255, 255, 0.025);

  color: var(--color-text-secondary);

  font-size: 12px;
  font-weight: 800;

  text-decoration: none;
  white-space: nowrap;

  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.settings-back:hover {
  border-color: rgba(0, 255, 102, 0.38);
  color: #00ff66;
  background: rgba(0, 255, 102, 0.035);
  transform: translateY(-1px);
}

/* =========================================================
   LAYOUT
   ========================================================= */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.settings-main {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-sidebar {
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 18px;

  position: sticky;
  top: 90px;
}

/* =========================================================
   CARD
   ========================================================= */

.settings-card {
  min-width: 0;

  padding: 24px;

  background: var(--color-surface);

  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  padding-bottom: 18px;
  margin-bottom: 20px;

  border-bottom: 1px solid var(--color-border-soft);
}

.settings-card-header h2,
.settings-save-card h2,
.settings-danger-card h2 {
  margin: 5px 0 0;

  color: var(--color-text-primary);

  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.3px;
}

.section-kicker {
  display: block;

  color: var(--color-primary);

  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.7px;

  text-transform: uppercase;
}

/* =========================================================
   FIELDS
   ========================================================= */

.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.settings-field {
  min-width: 0;
}

.settings-field:nth-child(3) {
  grid-column: 1 / -1;
}

.settings-field label,
.avatar-settings-content label {
  display: block;

  margin-bottom: 8px;

  color: var(--color-text-secondary);

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* =========================================================
   INPUTS / SELECTS / TEXTAREA
   ========================================================= */

.settings-field input,
.settings-field select,
.settings-field textarea,
.avatar-settings-content input {
  width: 100%;
  max-width: 100%;

  box-sizing: border-box;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  outline: none;

  background: var(--color-bg-soft);
  color: var(--color-text-primary);

  font-family: inherit;
  font-size: 13px;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.settings-field input,
.settings-field select,
.avatar-settings-content input {
  height: 44px;
  padding: 0 13px;
}

.settings-field textarea {
  min-height: 130px;

  padding: 13px;

  resize: vertical;

  line-height: 1.55;
}

.settings-field input::placeholder,
.settings-field textarea::placeholder,
.avatar-settings-content input::placeholder {
  color: #4f5663;
}

.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus,
.avatar-settings-content input:focus {
  border-color: rgba(0, 255, 102, 0.42);

  background: #0a0d12;

  box-shadow:
    0 0 0 3px rgba(0, 255, 102, 0.055),
    0 0 18px rgba(0, 255, 102, 0.035);
}

/* =========================================================
   NORMAL SELECT
   ========================================================= */

.settings-field select:not(.country-native-select) {
  appearance: none;
  -webkit-appearance: none;

  cursor: pointer;

  padding-right: 40px;

  background-color: #080a0e;

  background-image:
    linear-gradient(45deg, transparent 50%, #69717d 50%),
    linear-gradient(135deg, #69717d 50%, transparent 50%);

  background-position:
    calc(100% - 17px) 18px,
    calc(100% - 12px) 18px;

  background-size:
    5px 5px,
    5px 5px;

  background-repeat: no-repeat;
}

.settings-field select:not(.country-native-select):hover {
  border-color: #252c35;
}

.settings-field select:not(.country-native-select):focus {
  background-image:
    linear-gradient(45deg, transparent 50%, #00ff66 50%),
    linear-gradient(135deg, #00ff66 50%, transparent 50%);

  background-position:
    calc(100% - 17px) 18px,
    calc(100% - 12px) 18px;
}

/* =========================================================
   NATIVE COUNTRY SELECT
   ========================================================= */

.country-native-select {
  position: absolute !important;

  width: 1px !important;
  height: 1px !important;

  margin: -1px !important;
  padding: 0 !important;

  overflow: hidden !important;

  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;

  white-space: nowrap !important;

  border: 0 !important;
  opacity: 0 !important;

  pointer-events: none !important;
}

/* =========================================================
   COUNTRY CUSTOM SELECT
   ========================================================= */

.country-select {
  position: relative;

  width: 100%;
  min-width: 0;
}

/* BUTTON */

.country-select-button {
  position: relative;

  width: 100%;
  min-width: 0;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  box-sizing: border-box;

  padding: 0 12px 0 13px;

  border: 1px solid #1b2028;
  border-radius: 9px;

  outline: none;

  background: #080a0e;
  color: #ffffff;

  font-family: inherit;
  font-size: 12px;
  font-weight: 600;

  cursor: pointer;

  text-align: left;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.country-select-button:hover {
  border-color: #252c35;
  background: #090b0f;
}

.country-select.open .country-select-button {
  border-color: rgba(0, 255, 102, 0.42);

  background: #0a0d12;

  box-shadow:
    0 0 0 3px rgba(0, 255, 102, 0.055),
    0 0 18px rgba(0, 255, 102, 0.035);
}

/* SELECTED */

.country-selected {
  min-width: 0;

  display: flex;
  align-items: center;

  gap: 9px;

  overflow: hidden;
}

.country-selected-content {
  display: flex;
  align-items: center;
  gap: 9px;
}

.country-selected-name {
  min-width: 0;

  overflow: hidden;

  color: var(--color-text-primary);

  font-size: 13px;
  font-weight: 600;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.country-placeholder {
  color: var(--color-text-muted);

  font-size: 13px;
  font-weight: 500;
}

/* =========================================================
   FLAGS
   ========================================================= */

.country-flag {
  width: 20px !important;
  height: 14px !important;

  min-width: 20px !important;
  max-width: 20px !important;

  min-height: 14px !important;
  max-height: 14px !important;

  display: block !important;

  flex: 0 0 20px !important;

  object-fit: cover !important;

  border: 0 !important;
  outline: none !important;

  border-radius: 2px !important;

  background: transparent !important;

  box-shadow: none !important;

  vertical-align: middle;
}

/* =========================================================
   ARROW
   ========================================================= */

.country-arrow {
  width: 18px;
  height: 18px;

  flex: 0 0 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-left: 10px;

  color: #69717d;

  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;

  line-height: 1;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.country-select.open .country-arrow {
  color: #00ff66;

  transform: rotate(180deg);
}

/* =========================================================
   COUNTRY DROPDOWN
   ========================================================= */

.country-dropdown {
  position: absolute;

  z-index: 999;

  top: calc(100% + 7px);
  left: 0;
  right: 0;

  display: none;

  box-sizing: border-box;

  padding: 5px;

  background: var(--color-surface-2);

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.5),
    0 8px 18px rgba(0, 0, 0, 0.25);

  overflow: hidden;
}

.country-select.open .country-dropdown {
  display: block;
}

/* =========================================================
   COUNTRY OPTION
   ========================================================= */

.country-option {
  width: 100%;
  min-width: 0;
  min-height: 38px;

  display: flex;
  align-items: center;

  box-sizing: border-box;

  gap: 9px;

  padding: 0 9px;

  border: 0;
  border-radius: 7px;

  outline: none;

  background: transparent;

  color: var(--color-text-secondary);

  font-family: inherit;
  font-size: 13px;
  font-weight: 600;

  text-align: left;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.country-option:hover {
  background: rgba(255, 255, 255, 0.035);

  color: #ffffff;
}

.country-option.active {
  background: rgba(0, 255, 102, 0.055);

  color: #00ff66;
}

.country-option .country-flag {
  flex: 0 0 20px;
}

.country-option-name {
  min-width: 0;

  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;
}

/* =========================================================
   COUNTRY SCROLLBAR
   ========================================================= */

.country-dropdown::-webkit-scrollbar {
  width: 4px;
}

.country-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.country-dropdown::-webkit-scrollbar-thumb {
  background: #252b33;

  border-radius: 999px;
}

.country-dropdown::-webkit-scrollbar-thumb:hover {
  background: #343c47;
}

/* =========================================================
   DATE INPUT
   ========================================================= */

#birth-date {
  position: relative;

  color-scheme: dark;

  cursor: pointer;
}

/*
 * Chrome / Edge calendar icon.
 * Не перекрашиваем всё поле — только иконку.
 */

#birth-date::-webkit-calendar-picker-indicator {
  width: 16px;
  height: 16px;

  margin-right: 1px;

  opacity: 0.58;

  cursor: pointer;

  filter: invert(1) brightness(0.72);

  transition:
    opacity 0.2s ease,
    filter 0.2s ease;
}

#birth-date:hover::-webkit-calendar-picker-indicator {
  opacity: 0.9;

  filter: invert(1) brightness(0.95);
}

#birth-date:focus::-webkit-calendar-picker-indicator {
  opacity: 1;

  filter: invert(74%) sepia(45%) saturate(800%) hue-rotate(95deg)
    brightness(105%);
}

/* =========================================================
   BIO
   ========================================================= */

.settings-counter {
  margin-top: 7px;

  color: var(--color-text-muted);

  font-size: 12px;

  text-align: right;
}

/* =========================================================
   AVATAR
   ========================================================= */

.avatar-settings {
  display: flex;
  align-items: center;

  gap: 20px;
}

.settings-avatar {
  width: 86px;
  height: 86px;

  flex: 0 0 86px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;

  background:
    radial-gradient(
      circle at 35% 25%,
      rgba(0, 255, 102, 0.09),
      transparent 45%
    ),
    #080a0e;

  color: #00ff66;

  font-size: 22px;
  font-weight: 900;
}

.settings-avatar img {
  width: 100%;
  height: 100%;

  display: block;

  object-fit: cover;

  border-radius: 50%;
}

.avatar-settings-content {
  flex: 1;
  min-width: 0;
}

.settings-hint {
  display: block;

  margin-top: 7px;

  color: var(--color-text-muted);

  font-size: 12px;
}

/* =========================================================
   ACCOUNT
   ========================================================= */

.account-info {
  display: flex;
  flex-direction: column;
}

.account-row {
  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.account-row:last-child {
  border-bottom: 0;
}

.account-row span {
  color: var(--color-text-muted);

  font-size: 13px;
}

.account-row strong {
  color: var(--color-text-primary);

  font-size: 12px;
  font-weight: 800;

  text-align: right;
}

.account-status,
.account-verified {
  color: #00ff66 !important;
}

/* =========================================================
   SAVE CARD
   ========================================================= */

.settings-save-card {
  padding: 24px;
}

.settings-save-icon {
  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 18px;

  border: 1px solid rgba(0, 255, 102, 0.18);
  border-radius: 10px;

  background: rgba(0, 255, 102, 0.045);

  color: #00ff66;

  font-size: 16px;
  font-weight: 900;
}

.settings-save-card p,
.settings-danger-card p {
  margin: 12px 0 20px;

  color: var(--color-text-muted);

  font-size: 12px;
  line-height: 1.6;
}

.settings-save-button {
  width: 100%;
  min-height: 46px;
}

.settings-save-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* =========================================================
   MESSAGE
   ========================================================= */

.settings-message {
  min-height: 18px;

  margin-top: 13px;

  font-size: 12px;
  font-weight: 800;

  line-height: 1.4;
}

.settings-message.success {
  color: #00ff66;
}

.settings-message.error {
  color: #ff5c67;
}

/* =========================================================
   SECONDARY BUTTON
   ========================================================= */

.settings-secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 43px;

  box-sizing: border-box;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  background: rgba(255, 255, 255, 0.025);

  color: var(--color-text-secondary);

  font-size: 13px;
  font-weight: 850;

  text-decoration: none;

  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.settings-secondary-button:hover {
  border-color: rgba(0, 255, 102, 0.38);

  color: #00ff66;

  background: rgba(0, 255, 102, 0.035);

  transform: translateY(-1px);
}

/* =========================================================
   PRIMARY BUTTON — ONLY IF GLOBAL STYLE IS NOT ENOUGH
   ========================================================= */

.settings-save-button.btn-primary {
  border-color: rgba(0, 255, 102, 0.25);

  background: #00ff66;

  color: #05070a;

  font-weight: 900;

  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.settings-save-button.btn-primary:hover:not(:disabled) {
  background: #16ff77;

  box-shadow:
    0 0 24px rgba(0, 255, 102, 0.15),
    0 8px 22px rgba(0, 0, 0, 0.22);

  transform: translateY(-1px);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    position: static;
  }
}

@media (max-width: 650px) {
  .settings-page {
    padding: 35px 0 60px;
  }

  .settings-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .settings-fields {
    grid-template-columns: 1fr;
  }

  .settings-field:nth-child(3) {
    grid-column: auto;
  }

  .settings-card {
    padding: 19px;
  }

  .avatar-settings {
    align-items: flex-start;
    flex-direction: column;
  }

  .settings-avatar {
    width: 76px;
    height: 76px;

    flex-basis: 76px;
  }
}

@media (max-width: 480px) {
  .settings-heading h1 {
    font-size: 29px;
  }

  .settings-heading p {
    font-size: 12px;
  }

  .settings-card {
    padding: 17px;
  }

  .settings-card-header {
    margin-bottom: 17px;
    padding-bottom: 15px;
  }

  .country-dropdown {
    max-height: 220px;
  }
}
