:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --primary: hsl(231, 48%, 48%);
  --primary-foreground: #fafafa;
  --muted-foreground: #64748b;
  --destructive: #ef4444;
  --destructive-bg: rgba(239, 68, 68, 0.1);
  --destructive-border: rgba(239, 68, 68, 0.3);
  --border: rgba(15, 23, 42, 0.1);
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--foreground);
  background:
    radial-gradient(circle at top, rgb(108 63 245 / 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgb(45 45 45 / 0.06), transparent 24%),
    linear-gradient(180deg, rgb(248 250 252), rgb(241 245 249));
}

a, button, input {
  -webkit-tap-highlight-color: transparent;
}

/* ===== LAYOUT ===== */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background:
    radial-gradient(circle at 20% 20%, rgb(108 63 245 / 0.14), transparent 32%),
    radial-gradient(circle at 80% 80%, rgb(45 45 45 / 0.08), transparent 30%),
    linear-gradient(135deg, rgb(248 250 252), rgb(241 245 249));
}

@media (min-width: 1024px) {
  .login-shell {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== LEFT PANEL ===== */
.left-panel {
  position: relative;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  color: white;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .left-panel {
    display: flex;
  }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 0;
}

.bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.22), transparent 35%),
    radial-gradient(circle at bottom left, rgba(255,255,255,0.16), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 45%);
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  background: rgba(148, 163, 184, 0.2);
  z-index: 0;
}

.blob-1 {
  top: 25%;
  right: 25%;
  width: 16rem;
  height: 16rem;
  animation: float 12s ease-in-out infinite;
}

.blob-2 {
  bottom: 25%;
  left: 25%;
  width: 24rem;
  height: 24rem;
  background: rgba(203, 213, 225, 0.2);
  animation: float 16s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -18px, 0); }
}

.brand {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.characters-wrap {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 480px;
}

.footer-links {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

/* ===== CHARACTERS ===== */
.characters {
  position: relative;
  width: 550px;
  height: 400px;
}

.char {
  position: absolute;
  bottom: 0;
  transition: all 0.7s ease-in-out;
  transform-origin: bottom center;
}

.char-purple {
  left: 70px;
  width: 180px;
  height: 400px;
  background-color: #6C3FF5;
  border-radius: 10px 10px 0 0;
  z-index: 1;
}

.char-black {
  left: 240px;
  width: 120px;
  height: 310px;
  background-color: #2D2D2D;
  border-radius: 8px 8px 0 0;
  z-index: 2;
}

.char-orange {
  left: 0;
  width: 240px;
  height: 200px;
  background-color: #FF9B6B;
  border-radius: 120px 120px 0 0;
  z-index: 3;
}

.char-yellow {
  left: 310px;
  width: 140px;
  height: 230px;
  background-color: #E8D754;
  border-radius: 70px 70px 0 0;
  z-index: 4;
}

.face {
  position: absolute;
  display: flex;
  gap: 2rem;
  transition: all 0.7s ease-in-out;
}

.char-black .face { gap: 1.5rem; }
.char-orange .face, .char-yellow .face { gap: 2rem; transition: all 0.2s ease-out; }

.eye {
  border-radius: 9999px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.15s;
}

.eye .pupil {
  border-radius: 9999px;
  background-color: #2D2D2D;
  transition: transform 0.1s ease-out;
}

.pupil-only {
  border-radius: 9999px;
  background-color: #2D2D2D;
  transition: transform 0.1s ease-out;
}

.mouth {
  position: absolute;
  width: 5rem;
  height: 4px;
  background-color: #2D2D2D;
  border-radius: 9999px;
  transition: all 0.2s ease-out;
}

/* ===== RIGHT PANEL ===== */
.right-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--background);
}

@media (min-width: 640px) {
  .right-panel { padding: 2rem; }
}

.login-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  border-radius: 2rem;
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(22px);
  box-shadow: 0 40px 90px rgba(15,23,42,0.12);
  max-height: 92vh;
  overflow-y: auto;
}

.login-card::-webkit-scrollbar {
  width: 6px;
}
.login-card::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 999px;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 2rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.18));
  filter: blur(0.5px);
  z-index: -1;
  opacity: 0.9;
}

.mobile-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .mobile-brand { display: none; }
}

.header-text {
  text-align: center;
  margin-bottom: 1.5rem;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--primary);
  opacity: 0.85;
  margin: 0 0 0.5rem;
}

.header-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}

.subtitle {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 500;
}

.login-input {
  width: 100%;
  height: 2.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(15,23,42,0.12);
  background: var(--background);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
  font-family: inherit;
}

.login-input::placeholder {
  color: var(--muted-foreground);
}

.login-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgb(108 63 245 / 0.35), inset 0 1px 0 rgba(255,255,255,0.7);
}

.password-wrap {
  position: relative;
}

.password-wrap .login-input {
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted-foreground);
  display: flex;
  transition: color 0.2s;
}

.toggle-password svg {
  width: 1.15rem;
  height: 1.15rem;
}

.toggle-password:hover {
  color: var(--foreground);
}

.field-error {
  font-size: 0.775rem;
  color: var(--destructive);
  margin: 0;
  min-height: 0;
}

.field-error:empty {
  display: none;
}

.form-error {
  padding: 0.75rem;
  font-size: 0.85rem;
  color: var(--destructive);
  background: var(--destructive-bg);
  border: 1px solid var(--destructive-border);
  border-radius: 0.5rem;
}

/* ===== ROLE SELECTOR PILLS ===== */
.role-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.role-pill {
  position: relative;
  cursor: pointer;
}

.role-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.role-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted-foreground);
  transition: all 0.2s ease;
  user-select: none;
}

.role-pill:hover .role-pill-btn {
  border-color: var(--primary);
  color: var(--foreground);
  background: #ffffff;
}

.role-pill input:checked + .role-pill-btn {
  border-color: var(--primary);
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* ===== BUTTONS ===== */
.hover-btn {
  position: relative;
  display: inline-flex;
  width: 100%;
  height: 2.85rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--background);
  padding: 0.5rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  margin-top: 0.5rem;
}

.hover-btn-primary {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.25);
}

.hover-btn-primary .btn-label {
  color: #ffffff;
}

.hover-btn.full {
  width: 100%;
}

.hover-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.hover-btn:disabled {
  pointer-events: none;
  transform: none;
  opacity: 0.55;
}

.btn-label {
  display: inline-block;
  transition: all 0.3s;
}

.hover-btn:hover .btn-label {
  transform: translateX(3rem);
  opacity: 0;
}

.btn-hover {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  opacity: 0;
  transition: all 0.3s;
}

.hover-btn:hover .btn-hover {
  opacity: 1;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
}

/* ===== DIVIDER & GOOGLE BUTTON ===== */
.divider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.85rem;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(15, 23, 42, 0.12);
}

.divider-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.google-wrap {
  margin-top: 0.5rem;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  height: 2.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #ffffff;
  color: #1e293b;
  font-size: 0.925rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: all 0.25s ease;
}

.google-btn:hover {
  background: #f8fafc;
  border-color: rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.google-icon {
  height: 1.25rem;
  width: 1.25rem;
}


.login-link-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 1rem;
}

.login-link-text a {
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
}

.login-link-text a:hover {
  text-decoration: underline;
}

/* Suppress browser native password reveal icons to prevent double eye buttons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-credentials-auto-fill-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
