:root {
  /* Палитра */
  --color-morning-haze: #afcaf3;
  --color-lilac-dream: #8992fc;
  --color-wet-cement: #616160;
  --color-lime-sorbet: #d4fb9f;
  --color-pine-needle: #085c44;

  --bg-body: #f4f6fb;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-logo-mark: #e3ebff;

  --color-text-main: #111827;
  --color-text-muted: var(--color-wet-cement);
  --color-border-subtle: #e5e7eb;

  --color-primary: var(--color-pine-needle);
  --color-primary-dark: #06412f;
  --color-accent-blue: var(--color-lilac-dream);

  --font-family-heading: "Kanit", system-ui, -apple-system, sans-serif;
  --font-family-base: "Geologica", system-ui, -apple-system, sans-serif;

  --radius-pill: 999px;
  --radius-card: 28px;
}

*, *::before, *::after { box-sizing: border-box; }

html { visibility: hidden; }
html.styles-ready { visibility: visible; }

html, body {
  margin: 0;
  font-family: var(--font-family-base);
  background: var(--bg-body);
  color: var(--color-text-main);
}

/* --- LAYOUT (Desktop) --- */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-shell {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 400px 1fr;
  align-items: center;
  position: relative;
}

/* Карточка */
.auth-card {
  background: var(--bg-card);
  border-radius: 30px;
  padding: 40px 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  position: relative;
  z-index: 2;
  margin-right: -60px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Картинка справа */
.auth-media {
  position: relative;
  z-index: 1;
  height: 600px;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  background: var(--color-morning-haze);
}

.auth-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Логотип */
.auth-brand {
  position: absolute;
  top: 30px;
  left: 32px;
  display: flex; gap: 8px; align-items: center;
  text-decoration: none; color: inherit;
}
.auth-brand-text { font-weight: 700; font-family: var(--font-family-heading); }
.auth-brand-mark { width: 24px; height: 24px; background: var(--bg-logo-mark); border-radius: 6px; }

/* Тексты */
.auth-title {
  text-align: center;
  font-family: var(--font-family-heading);
  font-size: 36px;
  color: var(--color-lilac-dream);
  margin: 40px 0 10px;
}

.auth-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

/* Поля */
.auth-field { display: block; margin-bottom: 16px; }

.auth-input {
  width: 100%; height: 48px; padding: 0 20px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-pill);
  outline: none; font-size: 14px;
  background: #ffffff;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--color-accent-blue); }

/* Ссылки */
.auth-hint-link { text-align: center; font-size: 12px; margin: -6px 0 20px; }
.auth-hint-link a { color: var(--color-text-muted); text-decoration: underline; }

/* Кнопки */
.auth-submit {
  width: 100%; height: 48px; margin-top: 0;
  border-radius: var(--radius-pill); border: none;
  background: var(--color-accent-blue);
  color: #ffffff; font-weight: 700; font-size: 14px; text-transform: uppercase;
  cursor: pointer; transition: opacity 0.2s;
}
.auth-submit:hover { opacity: 0.9; }

.auth-submit.auth-submit--green {
  margin-top: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

/* Табы ролей */
.auth-role { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.auth-role-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--color-text-muted); font-weight: 600; padding: 4px 8px;
}
.auth-role-btn.is-active {
  color: var(--color-text-main);
  border-bottom: 2px solid var(--color-lilac-dream);
}

/* Логика переключения */
.auth-pane, .auth-form { display: none; }
.auth-pane.is-active, .auth-form.is-active { display: block; animation: fadein 0.3s; }

@keyframes fadein { from{opacity:0;} to{opacity:1;} }


/* --- MOBILE / TABLET ADAPTIVE --- */
@media screen and (max-width: 960px) {
  
  .auth {
    display: block !important;
    padding: 80px 20px 40px !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
  }

  .auth-shell {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
  }

  .auth-media { display: none !important; }

  .auth-card {
    width: 100% !important;
    margin: 0 !important;
    padding: 30px 24px !important;
    min-height: auto !important;
    overflow: visible !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
  }

  /* Логотип над карточкой */
  .auth-brand {
    position: absolute !important;
    top: -60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    justify-content: center !important;
    margin: 0 !important;
  }
  
  .auth-brand-text {
    font-size: 24px !important;
    color: var(--color-text-main) !important;
  }

  .auth-title {
    margin-top: 10px !important;
    font-size: 28px !important;
  }
}

