@import url('../shared/css/variables.css');
@import url('../shared/css/base.css');
@import url('../shared/css/components.css');
@import url('../shared/css/toast.css');

body.auth-page {
  overflow-x: hidden;
  background: #eef2f4;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
}

.auth-panel {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.auth-panel--left {
  justify-content: space-between;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.20), rgba(15, 23, 42, 0.72)),
    url('https://images.unsplash.com/photo-1516549655169-df83a0774514?auto=format&fit=crop&w=1600&q=80')
      center/cover no-repeat;
}

.auth-panel--left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.20), transparent 22%),
    radial-gradient(circle at 82% 24%, rgba(255, 255, 255, 0.11), transparent 18%),
    radial-gradient(circle at 78% 84%, rgba(255, 255, 255, 0.10), transparent 24%);
  pointer-events: none;
}

.auth-panel--right {
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fafb 0%, #eef2f4 100%);
}

.auth-brand,
.auth-features,
.auth-illustration {
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.auth-brand .brand-mark {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.auth-brand h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 1.3rem + 1vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-brand p {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
}

.auth-illustration {
  width: min(100%, 540px);
}

.auth-illustration svg {
  width: 100%;
  height: auto;
  opacity: 0.96;
}

.auth-features {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

.auth-feature i {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.92);
}

.auth-card {
  width: min(100%, 520px);
  padding: 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.auth-card h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 1.15rem + 0.8vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lead {
  margin-top: 10px;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.label {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}

.input,
.select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--color-text-primary);
}

.input::placeholder,
.select::placeholder {
  color: #94a3b8;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.5);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.password-field {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.password-field .input {
  flex: 1;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  display: inline-grid;
  place-items: center;
}

.icon-btn:hover {
  background: #f8fafc;
  border-color: var(--color-border-strong);
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.auth-footer a,
.link-button {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.link-button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

.field-error {
  min-height: 18px;
  color: var(--color-critical);
  font-size: 13px;
  line-height: 1.35;
}

.input.is-invalid {
  border-color: var(--color-critical);
  box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.08);
}

@media (max-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: auto;
    padding: 28px;
  }

  .auth-panel--left {
    min-height: 320px;
  }

  .auth-illustration {
    margin-top: 22px;
    margin-bottom: 18px;
  }

  .auth-panel--right {
    padding-top: 28px;
    padding-bottom: 28px;
  }
}

@media (max-width: 640px) {
  body.auth-page {
    overflow-y: auto;
  }

  .auth-panel {
    padding: 20px 16px;
  }

  .auth-card {
    width: 100%;
    padding: 22px 18px;
    border-radius: 22px;
  }

  .auth-brand h1 {
    font-size: 26px;
  }

  .auth-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .password-field {
    gap: 8px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }
}
