/* ═══════════════════════════════════════════════════════
   PROCERTS AI — AUTH PAGE REDESIGN
   auth.css — complete overhaul, no HTML changes required
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Auth-page design tokens ── */
:root {
  --auth-font: 'Plus Jakarta Sans', sans-serif;
  --panel-gradient: linear-gradient(155deg, #0d2f52 0%, #1a5285 38%, #2572a8 68%, #39A5F3 100%);
  --card-shadow:
    0 32px 96px rgba(10, 30, 60, 0.18),
    0 12px 40px rgba(57, 165, 243, 0.14),
    0 2px 8px  rgba(0, 0, 0, 0.07);
  --input-bg: #f6faff;
  --input-border-idle: #d8e9f7;
  --input-border-focus: #39A5F3;
  --input-focus-ring: rgba(57, 165, 243, 0.18);
  --text-heading: #0a1e32;
  --text-body: #3a5570;
  --text-muted: #8eadc6;
  --card-radius: 28px;
  --input-radius: 12px;
}

/* ═══════════════════════════════════════
   PAGE BACKGROUND
═══════════════════════════════════════ */

.welcome_container {
  font-family: var(--auth-font) !important;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background-color: #e8f3fc;
  background-image:
    radial-gradient(ellipse at 18% 40%, rgba(57, 165, 243, 0.13) 0%, transparent 55%),
    radial-gradient(ellipse at 82% 15%, rgba(37, 114, 168, 0.10) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 85%, rgba(13, 47, 82, 0.06) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='1.2' fill='%2339A5F3' fill-opacity='0.09'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════
   CARD — TWO-PANEL GRID
═══════════════════════════════════════ */

.welocome_main {
  display: grid;
  grid-template-columns: 340px 1fr;
  width: min(860px, 100%);
  min-height: 560px;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  text-align: left;
  padding: 0 !important;
  background: #ffffff;
  animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ═══════════════════════════════════════
   LEFT PANEL — BRAND / HERO
═══════════════════════════════════════ */

.image_box {
  background: var(--panel-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Large decorative ring — top-right */
.image_box::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  top: -130px;
  right: -130px;
  pointer-events: none;
  animation: ringBreath 7s ease-in-out infinite alternate;
}

@keyframes ringBreath {
  from { transform: scale(1);    opacity: 0.6; }
  to   { transform: scale(1.08); opacity: 1;   }
}

/* Tagline + features below the logo */
.image_box::after {
  content:
  '"Ask anything. Get clear,\Ainstant answers."\A\A✦  Any subject, any question\A✦  Detailed explanations on demand\A✦  Visa & education guidance too';
  white-space: pre-line;
  display: block;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--auth-font);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.85;
  text-align: center;
  max-width: 230px;
  letter-spacing: 0.1px;
}

/* Logo — shown in its original colours on a frosted white card */
.image_box img {
  width: auto;
  height: 90px;
  max-width: 200px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  /* NO filter — keep the logo's real colours */
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 14px 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.22),
    0 2px 8px  rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.18);
  animation: logoFloat 5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-5px); }
}

/* Small bottom decorative blob */
.image_box > *:last-child {
  position: relative;
  z-index: 1;
}

/* Extra soft bottom-left glow via box-shadow hack on the panel */
.image_box {
  box-shadow: inset -2px 0 60px rgba(0, 0, 0, 0.12);
}

/* ═══════════════════════════════════════
   RIGHT PANEL — FORM
═══════════════════════════════════════ */

.welcome_button_box {
  background: #ffffff;
  padding: 2.8rem 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 165, 243, 0.2) transparent;
}

/* Injected heading above the form */
.welcome_button_box::before {
  content: var(--page-title, 'Welcome');   /* fallback if var not set */
  display: block;
  font-family: var(--auth-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.welcome_button_box::after {
  content: var(--page-subtitle, '');
  display: block;
  font-family: var(--auth-font);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 1.6rem;
  letter-spacing: 0.1px;
  text-align: center;
}

/* ═══════════════════════════════════════
   FORM — GLOBAL RESET & FONT
═══════════════════════════════════════ */

.welcome_button_box form,
.welcome_button_box form * {
  font-family: var(--auth-font) !important;
}

/* ── Form grid ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ═══════════════════════════════════════
   LABELS
═══════════════════════════════════════ */

label {
  display: block;
  margin-bottom: 6px;
  margin-top: 4px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-body);
  padding-left: 2px;
}

/* ═══════════════════════════════════════
   INPUTS
═══════════════════════════════════════ */

input {
  width: 100%;
  padding: 11px 14px;
  outline: none;
  margin-bottom: 6px;
  border: 1.5px solid var(--input-border-idle);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  color: var(--text-heading);
  font-family: var(--auth-font) !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

input::placeholder {
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 300;
}

input:focus {
  border-color: var(--input-border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}

input:hover:not(:focus) {
  border-color: #a8cce6;
}

/* Autofill override */
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 60px #f0f7ff inset;
  -webkit-text-fill-color: var(--text-heading);
  caret-color: var(--text-heading);
}

/* Half-width inputs (inside form-row) */
.half-input {
  width: 100%;
  padding: 11px 14px;
  outline: none;
  margin-bottom: 6px;
  border: 1.5px solid var(--input-border-idle);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  color: var(--text-heading);
  font-family: var(--auth-font) !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.half-input::placeholder {
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 300;
}

.half-input:focus {
  border-color: var(--input-border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--input-focus-ring);
}

.half-input:hover:not(:focus) {
  border-color: #a8cce6;
}

/* ── Password input wrapper ── */
.input-container {
  position: relative;
  display: block;
  width: 100%;
}

.input-container input {
  padding-right: 44px;
  width: 100%;
}

.eye-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-60%);
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s ease;
  object-fit: contain;
}

.eye-icon:hover {
  opacity: 0.85;
}

/* ═══════════════════════════════════════
   SUBMIT BUTTON
═══════════════════════════════════════ */

button {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #1e6aad 0%, #2d91d8 50%, #39A5F3 100%);
  color: #ffffff;
  font-family: var(--auth-font) !important;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: block;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  box-shadow: 0 6px 22px rgba(57, 165, 243, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

/* Shimmer sweep on hover */
button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  transition: transform 0.45s ease;
}

button:hover::before {
  transform: translateX(100%);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(57, 165, 243, 0.52), 0 4px 10px rgba(0, 0, 0, 0.12);
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(57, 165, 243, 0.35);
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Specific override for the login/signup button in styles.css */
.welcome_button_box .login_btn {
  border-radius: 50px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  padding: 13px 20px !important;
  color: #ffffff !important;
}

/* ═══════════════════════════════════════
   LINKS
═══════════════════════════════════════ */

a {
  color: #2572a8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

a:hover {
  color: #39A5F3;
  text-decoration: underline;
}

/* ═══════════════════════════════════════
   MESSAGES
═══════════════════════════════════════ */

.error_message {
  color: #d94040;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 6px 10px;
  background: rgba(217, 64, 64, 0.06);
  border-radius: 8px;
  border-left: 3px solid rgba(217, 64, 64, 0.35);
  animation: errShake 0.3s ease;
}

/*
 * The password_error and password_mismatch spans live inside persistent
 * .error_message divs that are always in the DOM.  When the span is hidden
 * (style="display: none") the wrapper div must be invisible too —
 * otherwise the styled empty box is still visible.
 */
.error_message:has(> span[style*="display: none"]) {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  min-height: 0 !important;
}

/* Guard for genuinely empty divs */
.error_message:empty {
  display: none !important;
}

@keyframes errShake {
  0%, 100% { transform: translateX(0);    }
  20%, 60%  { transform: translateX(-4px); }
  40%, 80%  { transform: translateX(4px);  }
}

.error_message img {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.info_message {
  color: #1a7f4a;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
  text-align: left;
  padding: 6px 10px;
  background: rgba(26, 127, 74, 0.07);
  border-radius: 8px;
  border-left: 3px solid rgba(26, 127, 74, 0.35);
}

/* Inline password / mismatch error spans */
#password_error,
#password_mismatch {
  display: none;
  align-items: flex-start;
  gap: 5px;
  padding: 6px 10px;
  background: rgba(217, 64, 64, 0.06);
  border-radius: 8px;
  border-left: 3px solid rgba(217, 64, 64, 0.35);
  color: #d94040;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* ── Sign-in link paragraph ── */
.welcome_button_box form p {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Native select (kept in case it appears) ── */
select {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 6px;
  border: 1.5px solid var(--input-border-idle);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  color: var(--text-heading);
  font-family: var(--auth-font);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

/* ── Spinner hide on number inputs ── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ═══════════════════════════════════════
   STAGGERED FIELD ENTRANCE ANIMATIONS
═══════════════════════════════════════ */

.welcome_button_box form > * {
  animation: fieldIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome_button_box form > *:nth-child(1)  { animation-delay: 0.08s; }
.welcome_button_box form > *:nth-child(2)  { animation-delay: 0.13s; }
.welcome_button_box form > *:nth-child(3)  { animation-delay: 0.18s; }
.welcome_button_box form > *:nth-child(4)  { animation-delay: 0.23s; }
.welcome_button_box form > *:nth-child(5)  { animation-delay: 0.28s; }
.welcome_button_box form > *:nth-child(6)  { animation-delay: 0.33s; }
.welcome_button_box form > *:nth-child(7)  { animation-delay: 0.38s; }
.welcome_button_box form > *:nth-child(8)  { animation-delay: 0.43s; }
.welcome_button_box form > *:nth-child(9)  { animation-delay: 0.48s; }
.welcome_button_box form > *:nth-child(10) { animation-delay: 0.53s; }

@keyframes fieldIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ═══════════════════════════════════════
   RESPONSIVE — TABLET
═══════════════════════════════════════ */

@media (max-width: 700px) {
  .welocome_main {
    grid-template-columns: 1fr;
    min-height: unset;
    width: min(480px, 100%);
  }

  .image_box {
    padding: 2.5rem 2rem 2rem;
  }

  /* Collapse left panel to a compact header strip on mobile */
  .image_box::after {
    display: none; /* hide feature list on small screens */
  }

  .image_box img {
    height: 68px;
    max-width: 160px;
    padding: 10px 16px;
  }

  .image_box::before {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -80px;
  }

  .welcome_button_box {
    padding: 2rem 1.8rem;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════ */

@media (max-width: 425px) {
  .welcome_container {
    padding: 1rem 0.75rem;
    align-items: flex-start;
  }

  .welocome_main {
    border-radius: 20px;
    width: 100%;
  }

  .image_box {
    padding: 1.8rem 1.5rem 1.5rem;
  }

  .image_box img {
    height: 86px;
    max-width: 140px;
    padding: 10px 14px;
  }

  .welcome_button_box {
    padding: 1.8rem 1.4rem;
  }

  .welcome_button_box::before {
    font-size: 19px;
  }

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

  .half-input {
    width: 100%;
  }

  input {
    font-size: 16px; /* prevent iOS zoom */
  }

  .half-input {
    font-size: 16px;
  }
}

@media (max-width: 320px) {
  .welcome_button_box {
    padding: 1.4rem 1.1rem;
  }
}