@import url("https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #071f3c;
  --ink-soft: #153252;
  --ink-2: #263f5d;
  --mint: #70d39b;
  --mint-dark: #4fbd82;
  --paper: #ffffff;
  --paper-soft: #f7f8fa;
  --text: #0e1828;
  --muted: #9aa3ad;
  --line: #e4e7eb;
  --red: #b42318;
  --shadow-deep: 0 32px 80px rgba(5, 20, 40, 0.3);
  --shadow-soft: 0 18px 38px rgba(6, 22, 43, 0.12);
  font-family: "Exo 2", Arial, Helvetica, sans-serif;
  font-weight: 500;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--ink);
  font-family: "Exo 2", Arial, Helvetica, sans-serif;
  font-weight: 500;
}

button,
input {
  font: inherit;
}

a {
  color: var(--mint-dark);
  font-weight: 500;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

strong {
  font-weight: 600;
}

h1 {
  margin-bottom: 10px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  padding: clamp(14px, 4vw, 42px);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.08), transparent 24%),
    linear-gradient(145deg, var(--ink), var(--ink-2));
}

.auth-page::before,
.auth-page::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

.auth-page::before {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  left: -18vw;
  top: -16vw;
  border-radius: 0 0 46% 0;
  background: #f5f6f7;
}

.auth-page::after {
  width: 36vw;
  height: 36vw;
  min-width: 260px;
  min-height: 260px;
  right: -14vw;
  bottom: -15vw;
  border-radius: 52% 0 0 0;
  background: var(--mint);
}

.auth-layout {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
}

.auth-layout.wide {
  width: min(560px, 100%);
}

.auth-panel {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  padding: 30px clamp(20px, 6vw, 34px) 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 36px;
  background: linear-gradient(160deg, #061d38 0%, #102d4c 56%, #2d455f 100%);
  box-shadow: var(--shadow-deep);
}

.auth-layout.wide .auth-panel {
  min-height: 680px;
}

.auth-panel::before {
  content: "";
  position: absolute;
  left: -120px;
  top: 120px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.auth-panel::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -110px;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: rgba(112, 211, 155, 0.18);
}

.auth-mode-badge {
  position: relative;
  z-index: 1;
  width: 164px;
  height: 118px;
  display: grid;
  place-items: start center;
  margin: 42px auto 74px;
  padding-top: 30px;
  color: #fff;
  background: rgba(255, 255, 255, 0.065);
  border-radius: 38px 38px 64px 64px / 34px 34px 76px 76px;
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 1px;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.42),
    0 0 1px rgba(255, 255, 255, 0.9);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-panel > .brand-row {
  position: absolute;
  left: 30px;
  bottom: 26px;
  z-index: 1;
  color: rgba(255, 255, 255, 0.84);
}

.brand-row.compact {
  gap: 10px;
}

.brand-mark {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  align-content: center;
  border: 3px solid currentColor;
  border-radius: 50%;
  background: #fff;
  color: #071f3c;
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: 0;
  box-shadow: 0 10px 22px rgba(255, 255, 255, 0.16);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-48deg);
}

.brand-mark span {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 15px;
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.8px;
}

.brand-caption {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  letter-spacing: 0;
}

.auth-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 24px;
  color: #fff;
  text-align: center;
}

.auth-copy h1 {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}

.auth-copy p {
  max-width: 360px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}

.auth-panel > .form-grid {
  position: relative;
  z-index: 1;
  min-height: 242px;
  padding: 40px clamp(24px, 6vw, 38px) 62px;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.auth-layout.wide .auth-panel > .form-grid {
  min-height: 370px;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-grid.inline {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 11px;
}

label span {
  color: #aab0b8;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1.4px;
}

.field-label {
  padding-left: 0;
}

input {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  padding: 0 2px;
  color: var(--text);
  background: transparent;
  font-weight: 500;
  letter-spacing: 0.8px;
  font-size: 21px;
}

input:focus {
  border-color: var(--mint);
  outline: 0;
}

input:disabled {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

.phone-field {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-bottom: 2px solid var(--line);
  background: #fff;
}

.phone-field:focus-within {
  border-color: var(--mint);
}

.phone-field input {
  min-height: 58px;
  border: 0;
  padding: 0;
  outline: 0;
  font-size: 24px;
  font-weight: 500;
}

.phone-field input:focus {
  border-color: transparent;
  outline: 0;
}

.country-select {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 22px;
  background: rgba(112, 211, 155, 0.16);
  color: var(--text);
  padding: 0 14px;
  white-space: nowrap;
}

.country-select:disabled {
  opacity: 1;
}

.country-flag {
  font-size: 21px;
  line-height: 1;
}

.country-name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 48px;
  border: 0;
  border-radius: 28px;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-decoration: none;
}

.primary-button {
  background: var(--mint);
  color: #fff;
  box-shadow: 0 12px 28px rgba(80, 191, 130, 0.38);
}

.primary-button:hover {
  background: var(--mint-dark);
}

.auth-card-form > .primary-button {
  width: 184px;
  min-height: 48px;
  justify-self: center;
  margin-bottom: -78px;
  padding: 0 18px;
  font-size: 13px;
  letter-spacing: 1.1px;
}

.profile-form > .primary-button {
  justify-self: center;
  min-width: 210px;
}

.secondary-button {
  border: 1px solid rgba(112, 211, 155, 0.45);
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

.link-button {
  display: inline-grid;
  place-items: center;
}

.resend-form {
  position: relative;
  z-index: 1;
  margin-top: 52px;
  text-align: center;
}

.checkbox-row {
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 11px;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
  accent-color: var(--mint);
}

.checkbox-row span {
  color: var(--text);
  line-height: 1.45;
  letter-spacing: 0;
}

.alert {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
  border-radius: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.alert.error {
  border-color: rgba(255, 205, 205, 0.45);
  background: rgba(180, 35, 24, 0.18);
  color: #fff;
}

.alert.success {
  border-color: rgba(112, 211, 155, 0.5);
  background: rgba(112, 211, 155, 0.16);
  color: #fff;
}

.app-page {
  min-height: 100vh;
  background:
    linear-gradient(150deg, #071f3c 0%, #183452 48%, #f5f6f7 48.2%, #f5f6f7 100%);
}

.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 52px);
  color: #fff;
}

.topbar .brand-caption {
  color: rgba(255, 255, 255, 0.62);
}

.dashboard {
  width: min(1180px, calc(100% - 36px));
  margin: 18px auto 64px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  color: #fff;
}

.page-head h1 {
  color: #fff;
}

.page-head p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.66);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 24px;
  border: 1px solid rgba(11, 31, 60, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head p {
  margin-bottom: 0;
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(7, 31, 60, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.status-pill.ok {
  background: rgba(112, 211, 155, 0.2);
  color: #28714d;
}

.metric-row,
.plans-grid {
  display: grid;
  gap: 12px;
}

.metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-row div,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.metric-row span,
.table-row span,
.plan-meta {
  color: var(--muted);
  font-size: 14px;
}

.metric-row strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.table-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.table-row strong,
.table-row span {
  display: block;
}

.table-row strong {
  margin-bottom: 4px;
}

.plans-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-card {
  display: grid;
  gap: 10px;
  background: #fff;
}

.plan-card .secondary-button {
  margin-top: 8px;
}

.plan-price {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 980px) {
  .auth-layout {
    width: min(470px, 100%);
  }

  .auth-layout.wide {
    width: min(620px, 100%);
  }
}

@media (max-width: 860px) {
  .app-page {
    background: linear-gradient(180deg, #071f3c 0%, #183452 260px, #f5f6f7 260px);
  }

  .dashboard-grid,
  .plans-grid,
  .metric-row,
  .form-grid.inline {
    grid-template-columns: 1fr;
  }

  .page-head,
  .panel-head,
  .table-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .auth-page {
    display: block;
    padding: 0;
    background: linear-gradient(160deg, #061d38 0%, #102d4c 56%, #2d455f 100%);
  }

  .auth-page::before,
  .auth-page::after {
    display: none;
  }

  .auth-layout,
  .auth-layout.wide {
    width: 100%;
  }

  .auth-panel,
  .auth-layout.wide .auth-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-panel::before {
    left: -210px;
    top: 150px;
    width: 330px;
    height: 330px;
    background: rgba(245, 246, 247, 0.96);
  }

  .auth-panel::after {
    right: -220px;
    bottom: 80px;
    width: 330px;
    height: 330px;
    background: rgba(112, 211, 155, 0.94);
  }

  .auth-panel > .brand-row {
    left: 24px;
    bottom: 22px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
  }

  .brand-mark::after {
    width: 66px;
  }

  .brand-mark span {
    font-size: 13px;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-caption {
    font-size: 12px;
  }

  .auth-mode-badge {
    width: 150px;
    height: 108px;
    margin-top: 34px;
    margin-bottom: 64px;
    padding-top: 27px;
    font-size: 21px;
  }

  .auth-copy {
    display: none;
  }

  .auth-copy h1 {
    font-size: 22px;
  }

  .auth-panel > .form-grid {
    min-height: 230px;
    border-radius: 22px;
    padding: 38px 24px 60px;
  }

  .country-select {
    min-width: 82px;
    justify-content: center;
  }

  .phone-field input {
    font-size: 22px;
  }

  .auth-card-form > .primary-button {
    width: 164px;
    min-height: 44px;
    margin-bottom: -74px;
    font-size: 12px;
    letter-spacing: 1.1px;
  }

  .dashboard {
    width: min(100% - 24px, 1180px);
  }

  .panel {
    border-radius: 22px;
    padding: 20px;
  }
}
