/* PalmAgent Design System - Standalone CSS */
/* Cyan to Blue Real Estate Theme */

/* ================================
   CSS Variables / Design Tokens
   ================================ */
:root {
  /* Colors */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(215, 25%, 20%);
  
  --primary: hsl(214, 100%, 42%);
  --primary-foreground: hsl(0, 0%, 100%);
  
  --secondary: hsl(193, 100%, 49%);
  --secondary-foreground: hsl(0, 0%, 100%);
  
  --muted: hsl(210, 20%, 96%);
  --muted-foreground: hsl(215, 15%, 55%);
  
  --border: hsl(214, 20%, 88%);
  --ring: hsl(214, 100%, 42%);
  
  /* Gradients */
  --gradient-brand: linear-gradient(135deg, hsl(193, 100%, 49%) 0%, hsl(214, 100%, 42%) 100%);
  --gradient-brand-vertical: linear-gradient(180deg, hsl(193, 100%, 55%) 0%, hsl(214, 100%, 45%) 100%);
  
  /* Shadows */
  --shadow-card: 0 10px 40px -10px hsla(214, 100%, 42%, 0.15);
  --shadow-button: 0 4px 14px 0 hsla(214, 100%, 42%, 0.25);
  --shadow-input-focus: 0 0 0 3px hsla(193, 100%, 49%, 0.15);
  
  /* Spacing & Sizing */
  --radius: 0.75rem;
}

/* ================================
   Reset & Base Styles
   ================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ================================
   Layout
   ================================ */
.container {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ================================
   Brand Panel (Left Side)
   ================================ */
.brand-panel {
  display: none;
  width: 50%;
  background: var(--gradient-brand-vertical);
  position: relative;
  overflow: hidden;
}

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

@media (min-width: 1280px) {
  .brand-panel {
    width: 50%;
  }
}

/* Wave Separator */
.wave-separator {
  position: absolute;
  right: -1px;
  top: 0;
  height: 100%;
  width: 30px;
  z-index: 20;
}

.wave-separator svg {
  height: 100%;
  width: 100%;
}

/* Decorative Circles */
.decorative-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  animation: pulse-soft 4s ease-in-out infinite;
}

.circle-1 {
  top: 5rem;
  left: 2.5rem;
  width: 16rem;
  height: 16rem;
}

.circle-2 {
  bottom: 8rem;
  right: 5rem;
  width: 12rem;
  height: 12rem;
  animation-delay: 1s;
}

.circle-3 {
  top: 50%;
  left: 25%;
  width: 8rem;
  height: 8rem;
  animation-delay: 0.5s;
}

@keyframes pulse-soft {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* Brand Content */
.brand-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 3rem;
  text-align: center;
}

.brand-title {
  font-family: 'Poppins', sans-serif !important;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-foreground);
  margin-bottom: 2rem;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  animation: slide-in-left 0.6s ease-out;
}

@media (min-width: 1280px) {
  .brand-title {
    font-size: 3rem;
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.brand-logo {
  width: 120px;
  height: 120px;
  animation: fade-in 0.8s ease-out;
  animation-delay: 0.2s;
  animation-fill-mode: both;
  align-self: center;
}

.brand-logo-md {
  width: 80px;
  height: 80px;
}

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

.brand-tagline {
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
  max-width: 20rem;
  animation: fade-in 0.8s ease-out;
  animation-delay: 0.4s;
  animation-fill-mode: both;
}

/* ================================
   Form Panel (Right Side)
   ================================ */
.form-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 1024px) {
  .form-panel {
    width: 50%;
  }
}

/* Mobile Header */
.mobile-header {
  display: block;
  background: var(--gradient-brand-vertical);
  padding: 3rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

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

.mobile-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-foreground);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 10;
}

.mobile-header .brand-logo {
  position: relative;
  z-index: 10;
  margin: 0 auto;
}

.mobile-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 4rem;
}

.mobile-wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Form Container */
.form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.5rem;
  background-color: var(--background);
  overflow-y: auto;
  min-height: 0;
}

.form-container > .login-form,
.form-container > .success-state {
  margin: auto;
}

@media (min-width: 1024px) {
  .form-container {
    padding: 0 1.5rem;
  }
}

/* ================================
   Login Form
   ================================ */
.login-form {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fade-in 0.6s ease-out;
}

.form-header {
  margin-bottom: 0.5rem;
}

.form-title {
  font-size: 1.875rem;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.025em;
}

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

/* Input Group */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.input-group:focus-within .input-icon {
  color: var(--primary);
}

.input-underline {
  width: 100%;
  padding: 0.75rem 0 0.75rem 2rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-size: 1rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s;
}

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

.input-underline:focus {
  border-bottom-color: var(--primary);
}

.input-underline.input-error {
  border-bottom-color: hsl(0, 70%, 50%);
}

.input-underline.input-error:focus {
  border-bottom-color: hsl(0, 70%, 50%);
}

.toggle-password {
  position: absolute;
  right: 0;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

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

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

/* Form Options */
.form-options {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.5rem;
}

.forgot-link {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: var(--secondary);
}

/* Buttons */
.btn-primary {
  width: 100%;
  height: 3.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--primary-foreground);
  background: var(--gradient-brand);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: opacity 0.2s, transform 0.2s;
  margin-top: 1rem;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.btn-disabled {
  background: var(--muted);
  color: var(--muted-foreground);
  cursor: not-allowed;
  box-shadow: none;
}

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

.btn-primary.btn-disabled:active {
  transform: none;
}

.btn-outline {
  width: 100%;
  height: 3.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--foreground);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.btn-outline:hover {
  background-color: var(--muted);
  border-color: var(--muted-foreground);
}

/* Form Footer */
.form-footer {
  text-align: center;
  margin-top: 1.5rem;
}

.footer-text {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.signup-link {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.25rem;
  transition: color 0.2s;
}

.signup-link:hover {
  color: var(--secondary);
}

/* ================================
   Forgot Password Specific
   ================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--primary);
}

.back-link-center {
  justify-content: center;
  margin-top: 1rem;
  color: var(--primary);
  font-weight: 500;
}

.back-link-center:hover {
  color: var(--secondary);
}

/* Success State */
.success-state {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
  animation: fade-in 0.6s ease-out;
}

.success-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background-color: hsla(193, 100%, 49%, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--secondary);
}

.email-display {
  font-weight: 500;
  color: var(--foreground);
}

/* ================================
   Two-Step Login - Step Containers
   ================================ */
#loginStep1,
#loginStep2 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fade-in 0.4s ease-out;
}

#loginStep2 .form-subtitle .email-display {
  word-break: break-all;
}

/* ================================
   SSO Login Section
   ================================ */
.sso-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  margin: 0.5rem 0;
}

.sso-divider::before,
.sso-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.btn-sso {
  width: 100%;
  height: 3.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--primary-foreground);
  background: var(--gradient-brand);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: opacity 0.2s, transform 0.2s;
}

.btn-sso:hover {
  opacity: 0.9;
}

.btn-sso:active {
  transform: scale(0.98);
}

.sso-branding {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}

.sso-branding-img {
  height: 2.2rem;
  width: auto;
}

/* ================================
   Compact Layout for Short Screens
   ================================ */
@media (max-height: 750px) {
  .mobile-header {
    padding: 2rem 1.5rem 3.5rem;
  }

  .mobile-title {
    margin-bottom: 1rem;
  }

  .brand-logo-md {
    width: 60px;
    height: 60px;
  }

  .form-container {
    padding: 2rem 1.5rem;
  }

  .login-form {
    gap: 1rem;
  }

  #loginStep1,
  #loginStep2 {
    gap: 1rem;
  }

  .form-header {
    margin-bottom: 0.25rem;
  }

  .form-title {
    font-size: 1.5rem;
  }

  .btn-primary,
  .btn-sso {
    height: 3rem;
    font-size: 1rem;
    margin-top: 0.5rem;
  }

  .btn-sso {
    margin-top: 0;
  }

  .back-link {
    margin-bottom: 0.5rem;
  }

  .sso-divider {
    margin: 0.25rem 0;
  }

  .sso-branding {
    margin-top: 0.5rem;
  }
}

@media (max-height: 750px) and (min-width: 1024px) {
  .form-container {
    padding: 0 1.5rem;
  }
}

/* ================================
   Scaled Up Layout for Large Viewports (low browser zoom)
   ================================ */
@media (min-width: 1800px) {
  .login-form {
    max-width: 30rem;
    gap: 2rem;
  }

  #loginStep1,
  #loginStep2 {
    gap: 2rem;
  }

  .form-title {
    font-size: 2.75rem;
  }

  .form-subtitle {
    font-size: 1.125rem;
  }

  .input-underline {
    font-size: 1.25rem;
    padding: 1rem 0 1rem 2.5rem;
  }

  .input-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .btn-primary,
  .btn-sso {
    height: 4.25rem;
    font-size: 1.375rem;
  }

  .btn-outline {
    height: 4.25rem;
    font-size: 1.375rem;
  }

  .forgot-link,
  .footer-text,
  .signup-link {
    font-size: 1.125rem;
  }

  .back-link {
    font-size: 1.125rem;
  }

  .eye-icon {
    width: 1.5rem;
    height: 1.5rem;
  }

  .sso-divider {
    font-size: 1rem;
  }

  .sso-branding {
    margin-top: 1rem;
  }

  .sso-branding-img {
    height: 2.75rem;
  }

  .brand-title {
    font-size: 3.5rem;
  }

  .brand-logo {
    width: 160px;
    height: 160px;
  }

  .error-text {
    font-size: 1rem;
  }
}

/* ================================
   Utility Classes
   ================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
