/* ===== Auth pages (Sign In / Sign Up) ===== */

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

body.auth-page {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1b2e4b;
  background: #f5f6fa;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: #0168fa; text-decoration: none; }
a:hover { color: #0150c7; }

/* ---------- Language switcher (dropdown, next to logo) ---------- */
.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}
.auth-logo-row .auth-logo { margin-bottom: 0; }

.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #596882;
  background: #e8ecf1;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.auth-back:hover {
  background: #dce1e8;
  color: #1b2e4b;
}
.auth-back svg { flex-shrink: 0; }

.auth-lang-switch {
  position: relative;
}
.auth-lang-current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #596882;
  background: #e8ecf1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  border: none;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.auth-lang-current:hover {
  background: #dce1e8;
  color: #1b2e4b;
}
.auth-lang-current svg { flex-shrink: 0; }

.auth-lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 150px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  padding: 6px 0;
  z-index: 1050;
  display: none;
  animation: authFadeIn 0.15s ease;
}
.auth-lang-dropdown.open { display: block; }
.auth-lang-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(0,0,0,0.05);
}
.auth-lang-option {
  display: block;
  padding: 8px 16px;
  color: #596882;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}
.auth-lang-option:hover {
  background: #f5f6fa;
  color: #1b2e4b;
}
.auth-lang-option.active {
  color: #0168fa;
  font-weight: 600;
  background: #e8f0fe;
}
@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Flash messages ---------- */
.auth-flash {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: authFadeIn 0.2s ease;
}
.auth-flash-danger {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}
.auth-flash-success {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}
.auth-flash-info {
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #90cdf4;
}

/* ---------- Layout ---------- */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---------- Left: form card ---------- */
.auth-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
  max-width: 480px;
  margin: 0 auto;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1b2e4b;
  text-decoration: none;
  margin-bottom: 40px;
}
.auth-logo:hover { color: #1b2e4b; }
.auth-logo svg { color: #1b2e4b; flex-shrink: 0; }
.auth-logo .logo-word-black {
  display: inline-block;
  padding: 2px 7px 3px;
  margin: 0 -2px;
  border-radius: 4px;
  background: #05070a;
  color: #fff;
  line-height: 1;
}

.auth-title {
  font-size: 26px;
  font-weight: 700;
  color: #1b2e4b;
  margin: 0 0 6px;
}
.auth-sub {
  font-size: 14px;
  color: #7e8da2;
  margin: 0 0 32px;
}

/* ---------- Form ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: #596882;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.auth-field input {
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #1b2e4b;
  background: #fff;
  border: 1px solid #d5dce6;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field input::placeholder { color: #b4bdce; }
.auth-field input:focus {
  border-color: #0168fa;
  box-shadow: 0 0 0 3px rgba(1,104,250,0.1);
}

.auth-optional {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #b4bdce;
  margin-left: 4px;
}
.auth-hint {
  font-size: 11px;
  color: #b4bdce;
  margin-top: -2px;
}

/* ---------- Validation errors ---------- */
.auth-error {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 11px;
  font-weight: 500;
  color: #e53e3e;
  line-height: 1;
  pointer-events: none;
  transition: opacity 0.2s;
}
.auth-error:empty { display: none; }
.auth-field input.auth-input-error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,0.1);
}
.auth-field input.auth-input-error:focus {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229,62,62,0.15);
}

/* Disclaimer checkbox */
.auth-agree {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8f99a8;
  cursor: pointer;
  letter-spacing: 0.2px;
  position: relative;
}
.auth-agree input {
  accent-color: #0168fa;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.auth-agree.auth-agree-error span {
  color: #e53e3e;
}
.auth-agree.auth-agree-error input {
  outline: 2px solid #e53e3e;
  outline-offset: 1px;
}
.auth-agree-msg {
  position: absolute;
  top: -2px;
  right: 0;
  font-size: 11px;
  font-weight: 500;
  color: #e53e3e;
  pointer-events: none;
  transition: opacity 0.2s;
}
.auth-agree-msg:empty { display: none; }

/* ---------- Submit button ---------- */
.auth-btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #0168fa;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 2px 10px rgba(1,104,250,0.25);
}
.auth-btn:hover {
  background: #0150c7;
  box-shadow: 0 4px 16px rgba(1,104,250,0.35);
  transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }

/* ---------- Footer text ---------- */
.auth-footer-text {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: #7e8da2;
}
.auth-footer-text a { font-weight: 600; }

/* ---------- Right: aside panel ---------- */
.auth-aside {
  flex: 0 0 420px;
  background: linear-gradient(135deg, #0c1825 0%, #0f2238 50%, #0c1825 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}
.auth-aside::before {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(1,104,250,0.15) 0%, transparent 70%);
  top: 20%;
  right: -80px;
  pointer-events: none;
}
.auth-aside::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(105,178,248,0.1) 0%, transparent 70%);
  bottom: 10%;
  left: -40px;
  pointer-events: none;
}

.auth-aside-inner {
  position: relative;
  z-index: 1;
  max-width: 320px;
}

.auth-aside-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #69b2f8;
  background: rgba(1,104,250,0.12);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.auth-aside-inner h2 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  line-height: 1.2;
}
.auth-aside-inner p {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin: 0 0 28px;
}

/* Stats row */
.auth-aside-stats {
  display: flex;
  gap: 24px;
}
.auth-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.auth-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Divider between trial and project sections */
.auth-aside-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 24px 0;
}
.auth-aside-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  margin: 0 0 16px;
}

/* Features grid */
.auth-aside-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}
.auth-feature-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .auth-aside { display: none; }
  .auth-wrapper { justify-content: center; }
  .auth-card { max-width: 420px; padding: 32px 24px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 24px 16px; }
  .auth-title { font-size: 22px; }
}
