* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  background:
    radial-gradient(
      1000px 700px at 12% 4%,
      rgba(42, 48, 92, 0.95),
      transparent 55%
    ),
    radial-gradient(
      900px 600px at 88% 12%,
      rgba(74, 85, 140, 0.22),
      transparent 48%
    ),
    #0b0c10;
  color: #e9edf7;
}

[hidden] {
  display: none !important;
}

.auth-container {
  width: 100%;
  min-height: 100vh;
  padding: 28px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.auth-shell {
  width: min(100%, 1180px);
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

/* Left branding panel */
.auth-brand-panel {
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background:
    radial-gradient(
      circle at 28% 20%,
      rgba(233, 237, 247, 0.22),
      transparent 20%
    ),
    linear-gradient(145deg, rgba(39, 46, 88, 0.96), rgba(14, 17, 29, 0.98));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 118px;
  height: 118px;
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.25);
}

.brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  flex-shrink: 0;
}

.logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.68);
  transform-origin: center;
}

.brand-name {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-tag {
  margin-top: 3px;
  font-size: 13px;
  color: #aab2c5;
}

.eyebrow,
.auth-kicker {
  color: #aab2c5;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-copy h2 {
  margin: 12px 0 14px;
  max-width: 500px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: #ffffff;
}

.brand-copy p {
  max-width: 480px;
  margin: 0;
  color: #cfd6ea;
  line-height: 1.7;
  font-size: 15px;
}

.brand-feature-grid {
  display: grid;
  gap: 12px;
}

.brand-feature {
  padding: 14px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-feature span {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(233, 237, 247, 0.11);
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.brand-feature strong {
  color: #ffffff;
  font-size: 14px;
}

.brand-feature small {
  color: #aab2c5;
  font-size: 12px;
}

/* Right auth panel */
.auth-panel {
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.035),
      rgba(255, 255, 255, 0.015)
    ),
    rgba(10, 12, 18, 0.2);
}

.login-view,
.signup-view {
  width: min(100%, 680px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mobile-logo-wrap {
  display: none;
}

.auth-heading {
  margin-bottom: 20px;
}

.auth-heading h1 {
  margin: 8px 0 8px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 900;
  color: #ffffff;
}

.auth-heading p {
  margin: 0;
  color: #aab2c5;
  font-size: 15px;
  line-height: 1.55;
}

/* Forms */
.auth-form,
.signup-form {
  width: 100%;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-email,
.auth-password,
.login,
.field-group {
  width: 100%;
}

.field-label {
  display: block;
  margin: 0 0 7px 2px;
  color: #aab2c5;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-email input,
.auth-password input,
.signup-form input {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.025);
  padding: 0 16px;
  color: #e9edf7;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.auth-email input::placeholder,
.auth-password input::placeholder,
.signup-form input::placeholder {
  color: #7f889d;
}

.auth-email input:focus,
.auth-password input:focus,
.signup-form input:focus {
  border-color: rgba(233, 237, 247, 0.36);
  box-shadow: 0 0 0 3px rgba(233, 237, 247, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.signup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.signup-avatar-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.signup-avatar-preview-shell {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
}

.signup-avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.signup-avatar-copy {
  min-width: 0;
}

.signup-avatar-upload-btn {
  min-width: 140px;
  height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
  color: #e9edf7;
  font-size: 14px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease;
}

.signup-avatar-upload-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(233, 237, 247, 0.23);
}

.signup-avatar-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #8b93a8;
  line-height: 1.4;
}

/* Messages */
.form-error {
  width: 100%;
  margin: 0 0 14px;
  padding: 13px 16px;
  border-radius: 17px;
  border: 1px solid rgba(255, 99, 99, 0.68);
  background: rgba(255, 99, 99, 0.12);
  color: #ffb3b3;
  font-size: 14px;
  line-height: 1.45;
}

.form-error.success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.5);
}

/* Buttons */
.login-btn,
.signup-form button {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 0;
  background: #e9edf7;
  color: #0b0c10;
  font-size: 16px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    opacity 0.18s ease;
}

.login-btn:hover,
.signup-form button:hover {
  transform: translateY(-1px);
  background: #f4f6fb;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.login-btn:active,
.signup-form button:active {
  transform: translateY(1px) scale(0.99);
}

.login-btn:disabled,
.signup-form button:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.switch-text {
  margin: 14px 0 0;
  text-align: center;
  color: #aab2c5;
  font-size: 14px;
}

.sign-up-link,
.switch-text a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 750;
}

.auth-form input.is-invalid,
.signup-form input.is-invalid {
  border-color: rgba(255, 99, 99, 0.82);
}

.auth-form input.is-valid,
.signup-form input.is-valid {
  border-color: rgba(82, 210, 133, 0.82);
}

/* Tablet/mobile */
@media (max-width: 960px) {
  .auth-container {
    padding: 18px;
  }

  .auth-shell {
    min-height: calc(100vh - 36px);
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-panel {
    padding: 24px;
  }

  .mobile-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
  }

  .mobile-logo-wrap .logo {
    width: 104px;
    height: 104px;
    border-radius: 26px;
  }

  .auth-heading {
    text-align: center;
  }

  .login-view,
  .signup-view {
    width: min(100%, 680px);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .auth-container {
    padding: 0;
  }

  .auth-shell {
    min-height: 100vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .auth-panel {
    padding: 20px 14px;
    align-items: flex-start;
  }

  .login-view,
  .signup-view {
    min-height: calc(100vh - 40px);
  }

  .auth-form,
  .signup-form {
    padding: 16px;
    border-radius: 22px;
  }

  .signup-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .signup-avatar-block {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }

  .auth-heading h1 {
    font-size: 34px;
  }

  .auth-heading p {
    font-size: 14px;
  }

  .auth-email input,
  .auth-password input,
  .signup-form input,
  .login-btn,
  .signup-form button {
    height: 50px;
  }
}
