/* Login / Register - System-like style using main.css variables */

body {
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(8px);
  animation: authFloat 10s ease-in-out infinite;
}

body::before {
  width: 380px;
  height: 380px;
  top: 70px;
  right: -120px;
  background: radial-gradient(circle at center, rgba(212, 174, 82, 0.28), rgba(212, 174, 82, 0));
}

body::after {
  width: 320px;
  height: 320px;
  bottom: 30px;
  left: -100px;
  background: radial-gradient(circle at center, rgba(201, 149, 136, 0.28), rgba(201, 149, 136, 0));
  animation-delay: -4s;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: min(100% - 24px, 700px);
  margin: 110px auto 48px;
  padding: 24px;
  background: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  animation: authFadeUp 0.55s ease-out both;
}

.auth-container h2 {
  margin: 0 0 20px;
  text-align: center;
  color: var(--secondary-color);
  font-size: 1.45rem;
  font-weight: 800;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 700;
}

.form-group span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--dark-gray);
  font-size: 0.82rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group textarea {
  min-height: 92px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9ca3af;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(201, 162, 124, 0.18);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-left: 44px;
}

.password-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.password-toggle:hover {
  color: var(--primary-color);
  background: var(--light-gray);
}

.password-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 124, 0.18);
}

.form-group input.is-valid,
.form-group select.is-valid,
.form-group textarea.is-valid {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(201, 162, 124, 0.18);
}

.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.field-error {
  margin-top: 6px;
  color: var(--error-color);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  min-height: 18px;
}

.form-group input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  margin-top: 4px;
  accent-color: var(--primary-color);
  border-radius: 4px;
  box-shadow: none;
}

.btn-primary {
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: var(--on-primary, #333);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-gradient-hover);
  box-shadow: 0 10px 20px rgba(201, 162, 124, 0.28);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  min-height: 42px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  color: var(--text-color);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.error-message,
.success-message {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
}

.error-message {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.success-message {
  color: var(--success-color);
  background: #edf7ed;
  border: 1px solid #c8e6c9;
}

.auth-container p {
  margin-top: 16px;
  text-align: center;
  color: var(--dark-gray);
}

.auth-container p a {
  color: var(--rose-gold, #c9a27c);
  text-decoration: none;
  font-weight: 800;
}

.auth-container p a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Optional 2-column layouts used by some forms */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.terms-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.login-options-row .forgot-password-link {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.login-options-row .forgot-password-link:hover {
  text-decoration: underline;
}

@keyframes authFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -14px, 0) scale(1.04);
  }
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Image card beside the form. Sticky only while the form is in view; both scroll away together above the footer. */
body.auth-split-page {
  --auth-sticky-top: 112px;
}

body.auth-split-page::before,
body.auth-split-page::after {
  display: none;
}

.auth-split {
  display: flex;
  align-items: stretch;
  direction: ltr;
  gap: 20px;
  width: min(1140px, calc(100% - 32px));
  margin: 8px auto 40px;
}

.auth-split--image-left {
  flex-direction: row;
}

.auth-split--image-right {
  flex-direction: row-reverse;
}

.auth-split__visual {
  flex: 0.92 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.auth-split__visual-frame {
  position: sticky;
  top: var(--auth-sticky-top);
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  height: auto;
  aspect-ratio: 515 / 429;
  max-height: calc(100vh - var(--auth-sticky-top) - 20px);
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: #f6eee8;
  box-shadow: var(--shadow);
  animation: authFadeUp 0.55s ease-out both;
}

.auth-split__visual-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.auth-split__panel {
  flex: 1.08 1 0;
  min-width: 0;
  direction: rtl;
}

.auth-split .auth-container {
  width: 100%;
  margin: 0;
}

@media (min-width: 992px) {
  body.auth-split-page {
    --auth-sticky-top: 140px;
  }
}

@media (max-width: 991px) {
  .auth-split,
  .auth-split--image-left,
  .auth-split--image-right {
    flex-direction: column;
    width: min(640px, calc(100% - 16px));
    margin-top: 4px;
  }

  .auth-split__visual,
  .auth-split__panel {
    flex: none;
    width: 100%;
  }

  .auth-split__visual-frame {
    position: relative;
    top: auto;
    flex: none;
    height: min(62vw, 320px);
    max-height: none;
  }
}

@media (max-width: 768px) {
  body::before {
    width: 260px;
    height: 260px;
    right: -110px;
  }

  body::after {
    width: 220px;
    height: 220px;
    left: -90px;
  }

  .auth-container {
    width: min(100% - 16px, 600px);
    margin-top: 90px;
    padding: 16px;
    border-radius: 12px;
  }

  .auth-container h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
