@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap");

*, body {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

html, body { height: 100%; margin: 0; }
body { background-color: #fff; color: var(--auth-text); }
.form-body { background-color: #fff; height: 100%; }

/* Layout */
.i4thol-layout { display: flex; min-height: 100vh; }

/* Left panel */
.img-holder {
  display: inline-block;
  position: relative;
  width: 720px;
  min-height: 100vh;
  background-color: transparent;
  padding: 60px;
  overflow: hidden;
}

.img-holder .bg {
  position: absolute;
  inset: 30px 0 30px 30px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 22%),
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, 0.32), transparent 18%),
    linear-gradient(135deg, var(--auth-visual-start) 0%, var(--auth-visual-mid) 54%, var(--auth-visual-end) 100%);
}

.img-holder .bg::before,
.img-holder .bg::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.img-holder .bg::before { width: 420px; height: 420px; bottom: -110px; left: -70px; opacity: 0.55; }
.img-holder .bg::after { width: 320px; height: 320px; top: -40px; right: -60px; opacity: 0.45; }

.info-holder {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 25px 30px 30px;
}

/* Logo */
.website-logo-inside { margin-bottom: 20px; }
.brand-logo { max-height: var(--logo-height, 42px); max-width: var(--logo-width, 180px); object-fit: contain; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  height: var(--logo-height, 42px);
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--auth-primary);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Hero text */
.hero-copy { max-width: 460px; margin-top: auto; padding-bottom: 30px; }
.hero-copy h3 { color: var(--auth-text); font-size: 46px; line-height: 52px; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 24px; }
.hero-copy p { color: var(--auth-text); font-size: 18px; line-height: 30px; margin: 0; max-width: 378px; }

/* Right panel */
.form-holder { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.form-content { width: 100%; max-width: 520px; text-align: center; }

/* Form headings */
.form-items h3 { color: var(--auth-text); font-size: 32px; line-height: 40px; font-weight: 900; margin: 0 0 14px; }
.form-items p { color: var(--auth-text); font-size: 16px; line-height: 24px; margin: 0 0 30px; }

/* Toast container */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
}

.toast {
  padding: 14px 40px 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  animation: toastIn 0.3s ease;
  position: relative;
}

.toast-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  opacity: 0.6;
}

.toast-close:hover { opacity: 1; }

.toast-success { background: #e7f5ea; color: #20603a; }
.toast-danger { background: #fae8eb; color: #8d3448; }

.toast.fade-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* Inline alerts (fallback for non-JS) */
.alert { margin-bottom: 18px; padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 20px; text-align: left; }
.alert-success { background: #e7f5ea; color: #20603a; }
.alert-danger { background: #fae8eb; color: #8d3448; }

/* Form controls */
.form-control,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 6px;
  background-color: var(--auth-input-bg);
  color: #000;
  font-size: 15px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  outline: 0;
  background-color: color-mix(in srgb, var(--auth-input-bg) 82%, #000);
}

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

/* Grid layout (apply form) */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }
.grid .form-control,
.grid .form-select,
.grid .form-textarea { margin-bottom: 0; }
.field-full { grid-column: 1 / -1; }

/* Placeholder */
.form-control::placeholder { color: #aaa; }

/* Floating label with required star */
.field-label { display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; color: #666; text-align: left; margin-bottom: 6px; }
.field-label .required { color: #dc2626; margin-left: 2px; }

/* Field errors */
.field-error { margin-top: 6px; font-size: 12px; color: #aa314f; display: none; }
.field-error.show { display: block; }
.is-invalid { box-shadow: inset 0 0 0 1px #d55d7a; background: #fff3f6; }

/* Buttons */
.form-button { display: flex; gap: 10px; margin-top: 6px; width: 100%; }
.form-button .btn { flex: 1; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.btn-primary { color: #fff; background-color: var(--auth-primary); border-color: var(--auth-primary); }
.btn-primary:hover { background-color: var(--auth-primary-hover); border-color: var(--auth-primary-hover); }
.btn-outline-primary { color: var(--auth-primary); border-color: var(--auth-primary); background: transparent; }
.btn-outline-primary:hover { color: #fff; background-color: var(--auth-primary); }
.btn:disabled { opacity: 0.7; cursor: wait; }

/* Links */
.other-links { margin-top: 28px; font-size: 14px; color: #000; text-align: center; }
.other-links span { display: block; margin-bottom: 12px; }
.other-links a { text-decoration: none; color: var(--auth-primary); font-weight: 600; }
.other-links a:hover { text-decoration: underline; }

/* Forgotten link */
.forgotten-link { text-align: right; margin: -4px 0 12px; font-size: 13px; }
.forgotten-link a { color: var(--auth-primary); text-decoration: none; }
.forgotten-link a:hover { text-decoration: underline; }

/* Password toggle */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 46px; }
.password-toggle {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 14px;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}
.password-toggle:hover { color: var(--auth-primary); }
.password-toggle svg { width: 20px; height: 20px; }

/* Form check */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  padding: 14px 0;
}

.form-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid #ccc;
  border-radius: 4px;
  margin-top: 1px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.form-check input[type="checkbox"]:checked {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
}

.form-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-check span { color: var(--auth-text); }
.form-check a { color: var(--auth-primary); font-weight: 600; }

/* Language switcher dropdown */
.language-switcher { position: absolute; top: 28px; right: 28px; z-index: 10; }
.language-switcher-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
}
.language-switcher-toggle:hover { background: color-mix(in srgb, var(--auth-input-bg) 82%, #000); }
.language-switcher-toggle::after { content: ""; border: 4px solid transparent; border-top-color: var(--auth-text); margin-top: 2px; }
.language-dropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 6px; background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); overflow: hidden; min-width: 200px; }
.language-dropdown.open { display: block; }
.language-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--auth-text); text-decoration: none; transition: background 0.15s; }
.language-dropdown a:hover { background: var(--auth-input-bg); }
.language-dropdown a.active { color: var(--auth-primary); }
.lang-flag { width: 16px; height: 11px; border-radius: 2px; object-fit: cover; }

/* Responsive */
@media (max-width: 1100px) {
  .img-holder { width: 54%; padding: 34px; }
  .img-holder .bg { inset: 16px 0 16px 16px; }
  .hero-copy h3 { font-size: 38px; line-height: 44px; }
}

@media (max-width: 860px) {
  .i4thol-layout { flex-direction: column; }
  .img-holder { width: 100%; min-height: auto; padding: 20px; }
  .img-holder .bg { inset: 0; border-radius: 0 0 26px 26px; }
  .info-holder { padding: 22px 20px 32px; }
  .hero-copy { padding-top: 26px; padding-bottom: 26px; }
  .hero-copy h3 { font-size: 32px; line-height: 38px; }
  .hero-copy p { font-size: 16px; line-height: 26px; }
  .form-holder { padding: 34px 20px 42px; }
  .grid { grid-template-columns: 1fr; }
  .field-full, .grid > div { grid-column: auto; }
}
