.account-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(223, 31, 45, 0.08), transparent 34%),
    linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    #ffffff;
  background-size: auto, 72px 72px, 72px 72px, auto;
}

.account-card {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
}

.account-card h1 {
  margin: 0 0 12px;
  color: #111317;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
}

.account-card h2 {
  margin: 0 0 8px;
  color: #111317;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.12;
}

.account-card p {
  color: #4f5663;
  line-height: 1.65;
}

.account-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-message {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: #b91c1c;
  font-weight: 800;
}

.account-message.success {
  color: #15803d;
}

.account-message.error {
  color: #b91c1c;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.account-detail,
.cart-line,
.cart-summary-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: #fbfbfc;
}

.account-detail span,
.cart-line span,
.cart-summary-card span {
  color: #626a76;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-detail strong,
.cart-line strong,
.cart-summary-card strong {
  color: #111317;
  line-height: 1.45;
}

.account-history {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 24px;
  align-items: start;
}

.cart-items,
.cart-summary {
  display: grid;
  gap: 14px;
}

.cart-summary-card strong {
  font-size: 1.35rem;
}

.auth-nav-group {
  display: inline-flex;
  gap: 16px;
  align-items: center;
}

.auth-nav-group[hidden] {
  display: none !important;
}

.auth-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #34363a;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.auth-link-button:hover,
.auth-link-button:focus-visible {
  color: #df1f2d;
}

.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4f5663;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle.is-showing {
  background: rgba(223, 31, 45, 0.1);
  color: #df1f2d;
}

.password-toggle:focus-visible {
  outline: 3px solid rgba(223, 31, 45, 0.22);
  outline-offset: 2px;
}

.password-icon {
  width: 21px;
  height: 21px;
}

.password-icon-hide {
  display: none;
}

.password-toggle.is-showing .password-icon-show {
  display: none;
}

.password-toggle.is-showing .password-icon-hide {
  display: block;
}

.checkout-block {
  display: none;
  gap: 12px;
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 4px solid #df1f2d;
  border-radius: 16px;
  background: rgba(223, 31, 45, 0.07);
  color: #4f5663;
}

.checkout-block.is-visible {
  display: grid;
}

.checkout-agreement {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: #fbfbfc;
}

.checkout-agreement p {
  margin: 0;
  color: #34363a;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.5;
}

.agreement-checkbox {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #4f5663;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
}

.agreement-checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #df1f2d;
}

.agreement-link {
  justify-self: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: #df1f2d;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

.agreement-link:hover,
.agreement-link:focus-visible {
  color: #991b1b;
}

button[disabled].button-primary,
.button-primary[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.agreement-modal[hidden] {
  display: none !important;
}

.agreement-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 28px);
}

.agreement-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 19, 23, 0.68);
}

.agreement-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.28);
  outline: none;
}

.agreement-modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #df1f2d;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.agreement-content {
  display: grid;
  gap: 12px;
  color: #34363a;
}

.agreement-content h2 {
  margin: 0 44px 6px 0;
  color: #111317;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.agreement-content h3 {
  margin: 18px 0 0;
  color: #111317;
  font-size: 1.18rem;
  line-height: 1.2;
}

.agreement-content p,
.agreement-content li {
  margin: 0;
  color: #4f5663;
  line-height: 1.62;
}

.agreement-content ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.agreement-content a {
  color: #df1f2d;
  font-weight: 850;
}

.agreement-modal-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .account-form-grid {
    grid-template-columns: 1fr;
  }

  .account-actions {
    display: grid;
  }

  .account-actions .button {
    width: 100%;
    justify-content: center;
  }

  .password-toggle {
    width: 44px;
    height: 44px;
  }

  .agreement-modal {
    align-items: end;
    padding: 10px;
  }

  .agreement-modal-panel {
    max-height: 88vh;
    border-radius: 20px;
  }
}
