@import url("styles.css");

:root {
  --account-bg: linear-gradient(135deg, #f7f4ea 0%, #eef4ef 100%);
  --account-border: rgba(23, 59, 53, 0.09);
}

.account-page {
  min-height: 100vh;
  padding: 40px;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  background: #123a33;
}

@media (min-width: 981px) {
  .account-page:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("images/hero-liman.webp");
    background-size: cover;
    background-position: center 25%;
  }

  .account-page:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(10, 42, 37, 0.88) 0%, rgba(10, 42, 37, 0.5) 55%, rgba(9, 36, 31, 0.72) 100%);
  }

  /* Без власного фону .account-intro розтягнута висота (align-items:stretch)
     не мала видимого нижнього краю — фото просто тривало під текстом.
     Легка напівпрозора підкладка (не суцільна картка) дає реальний край,
     який тепер вирівнюється по нижньому краю картки входу праворуч. */
  .account-intro {
    height: 100%;
    background: rgba(9, 36, 31, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    backdrop-filter: blur(3px);
  }
}

.account-layout {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 30px;
  align-items: stretch;
}

.account-card {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--account-border);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(23, 59, 53, 0.09);
}

.account-intro {
  padding: 32px 28px;
  position: sticky;
  top: 24px;
  overflow: hidden;
  color: #fff;
}

/* На десктопі фото вже на весь .account-page — тут просто текст поверх нього,
   без власної картки й другого шару фото. На мобільному колонки складаються
   в одну, і фото на всю сторінку виглядало б розтягнутим під високий контент,
   тож там .account-intro лишається власною контрастною карткою з фото. */
@media (max-width: 980px) {
  .account-intro {
    border-radius: 28px;
    background: #123a33;
  }

  .account-intro:before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("images/hero-liman.webp");
    background-size: cover;
    background-position: center 20%;
  }

  .account-intro:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(190deg, rgba(10, 42, 37, 0.82) 0%, rgba(10, 42, 37, 0.58) 45%, rgba(9, 36, 31, 0.94) 100%);
  }
}

.account-intro > * {
  position: relative;
  z-index: 1;
}

.account-home {
  display: inline-flex;
  margin-bottom: 20px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.account-intro .eyebrow.dark {
  color: #fff;
}

.account-intro h1 {
  color: #fff;
}

.account-intro h1 em {
  font-style: normal;
  color: #f2d69a;
}

.account-intro p {
  color: #fff;
}

.role-ask {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.role-ask > strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}

.role-toggle {
  display: flex;
  gap: 8px;
}

.role-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  color: #fff;
}

.role-btn strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  opacity: 1;
}

.role-btn[aria-pressed="true"] {
  border-width: 2px;
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 4px rgba(232, 120, 85, 0.28);
}

.role-btn[aria-pressed="true"] strong {
  color: #fff;
  opacity: 1;
}

.plot-field {
  margin-top: 14px;
}

.plot-field-row {
  display: flex;
  gap: 10px;
}

.plot-field-row > div {
  flex: 1;
}

.plot-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  display: block;
}

.plot-field label b {
  color: var(--coral);
  font-weight: 800;
}

.plot-field input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  padding: 15px 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.3;
}

.plot-field.has-error input {
  border-color: var(--coral);
}

.plot-field small {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.75;
  line-height: 1.4;
}

.phone-field {
  margin-top: 14px;
}

.phone-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  display: block;
}

.phone-field label b {
  color: var(--coral);
  font-weight: 800;
}

.phone-field input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  padding: 15px 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.3;
}

.phone-field.has-error input {
  border-color: var(--coral);
}

.phone-field small {
  display: block;
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.4;
  font-weight: 700;
}

.phone-field small.verify-ok {
  color: #a8e6c9;
}

.phone-field small.verify-error {
  color: #f2b8a8;
}

#introVerifyCode[readonly] {
  opacity: 0.85;
  cursor: default;
}

.account-intro h1,
.account-card h2 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.account-card p,
.account-note {
  color: rgba(23, 59, 53, 0.74);
  line-height: 1.7;
  font-size: 14px;
}

.account-panel {
  display: grid;
  gap: 24px;
}

.account-card {
  padding: 34px 36px;
}

.register-panel {
  background: rgba(255, 255, 255, 0.96);
}

.register-divider {
  position: relative;
  margin: 26px 0 20px;
  border-top: 1px solid rgba(23, 59, 53, 0.1);
}

.register-divider span {
  position: absolute;
  left: 50%;
  top: -11px;
  transform: translateX(-50%);
  padding: 0 12px;
  background: #fff;
  color: rgba(23, 59, 53, 0.45);
  font-size: 11px;
  text-transform: uppercase;
}

.social-register {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid rgba(23, 59, 53, 0.12);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.social-register b {
  font-size: 22px;
  color: #4285f4;
}

.auth-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(220, 235, 227, 0.45);
  margin-bottom: 18px;
}

.auth-switch button {
  flex: 1;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(23, 59, 53, 0.7);
  font-weight: 800;
  padding: 13px 18px;
  cursor: pointer;
}

.auth-switch button.active {
  background: #fff;
  color: var(--deep);
  box-shadow: 0 10px 24px rgba(23, 59, 53, 0.08);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.email-label {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.email-label input,
.field-grid input,
.field-grid select,
.field-grid textarea {
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(23, 59, 53, 0.12);
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
}

.field-grid textarea {
  resize: vertical;
  min-height: 112px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(23, 59, 53, 0.62);
  cursor: pointer;
}

.password-toggle:hover {
  background: rgba(23, 59, 53, 0.08);
  color: var(--deep);
}

.email-login {
  width: 100%;
  height: 54px;
  margin-top: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--deep);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.account-note {
  margin-top: 14px;
  min-height: 22px;
}

.account-note.state-success,
.account-note.state-warning {
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.account-note.state-success {
  background: rgba(47, 118, 104, 0.12);
}

.account-note.state-warning {
  background: rgba(176, 88, 52, 0.1);
}

.google-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: 18px;
  background: rgba(220, 235, 227, 0.45);
}

.google-profile strong,
.google-profile small {
  display: block;
}

.google-profile small {
  color: rgba(23, 59, 53, 0.64);
}

.google-profile-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--deep);
  font-weight: 800;
}

.ghost-button {
  margin-left: auto;
  border: 1px solid rgba(23, 59, 53, 0.14);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field-grid label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.field-grid .field-wide {
  grid-column: 1 / -1;
}

.security-note,
.success-number {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(220, 235, 227, 0.44);
}

.success-number {
  font-weight: 800;
  font-size: 18px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.account-actions .button {
  min-width: 180px;
}

.account-loading {
  min-height: 220px;
}

.state-success {
  color: #2f7668;
}

.state-warning {
  color: #b05834;
}

.dashboard-link {
  color: var(--green);
  font-weight: 800;
}

html[data-theme="dark"] .account-card {
  background: #142622;
  border-color: #29413b;
}

@media (max-width: 980px) {
  html[data-theme="dark"] .account-intro {
    border-color: #29413b;
  }
}

html[data-theme="dark"] .register-divider span,
html[data-theme="dark"] .auth-switch button.active,
html[data-theme="dark"] .ghost-button {
  background: #1b332d;
  color: var(--ink);
}

html[data-theme="dark"] .social-register,
html[data-theme="dark"] .email-label input,
html[data-theme="dark"] .field-grid input,
html[data-theme="dark"] .field-grid select,
html[data-theme="dark"] .field-grid textarea {
  background: #192d28;
  border-color: #29413b;
  color: var(--ink);
}

@media (max-width: 980px) {
  .account-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .account-intro {
    position: relative;
  }
}

@media (max-width: 640px) {
  .account-page {
    padding: 18px;
  }

  .account-card,
  .account-intro {
    padding: 22px 18px;
    border-radius: 22px;
  }

  .account-home {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .account-intro .eyebrow.dark {
    margin-top: 0;
  }

  .account-intro h1 {
    font-size: 26px !important;
    margin: 8px 0 8px;
  }

  .account-intro > p {
    font-size: 12.5px;
  }

  .role-ask {
    margin-top: 16px;
    padding-top: 14px;
  }

  .role-ask > strong {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .role-btn {
    padding: 10px 8px;
  }

  .plot-field {
    margin-top: 10px;
  }

  .plot-field input {
    padding: 12px 14px;
    font-size: 16px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .account-actions {
    flex-direction: column;
  }

  .account-actions .button,
  .ghost-button {
    width: 100%;
  }

  .google-profile {
    flex-wrap: wrap;
  }

  .ghost-button {
    margin-left: 0;
  }
}
