/* ==============================================
   YARN STORE - LOGIN PAGE STYLES
   Modern split-screen login design
   ============================================== */

/* Reset & Base */
.login-page-body {
  margin: 0;
  padding: 0;
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  direction: ltr; /* Override for login page */
}

/* Full Page Wrapper */
.login-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

/* Main Container Card */
.login-container {
  display: flex;
  width: 100%;
  max-width: 1100px;
  min-height: 650px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* ==============================================
   LEFT PANEL - BRANDING
   ============================================== */
.login-branding-panel {
  flex: 1;
  background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Decorative background shapes */
.login-branding-panel::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.login-branding-panel::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.branding-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #ffffff;
  max-width: 400px;
}

.branding-content h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 20px 0;
  text-align: left;
}

.branding-content > p {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin: 0 0 40px 0;
  text-align: left;
}

.branding-illustration {
  display: flex;
  justify-content: center;
}

.branding-illustration img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 20px; 
  overflow: hidden;    /* Ensures the image doesn't bleed past the corners */
  display: block;      /* Removes any tiny gaps at the bottom of the image */
}

/* ==============================================
   RIGHT PANEL - FORM
   ============================================== */
.login-form-panel {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.form-wrapper {
  width: 100%;
  max-width: 380px;
}

/* Logo Section */
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.login-logo img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.login-logo .logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a2e;
}

/* Welcome Text */
.login-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px 0;
  text-align: center;
}

.login-subtitle {
  text-align: center;
}

/* ==============================================
   FORM ELEMENTS
   ============================================== */
.login-form-container {
  margin-bottom: 25px;
}

/* Hide default Drupal form labels visually but keep accessible */
.login-form-container .js-form-item > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Form Items */
.login-form-container .js-form-item {
  margin-bottom: 18px;
  position: relative;
}

/* Input Fields */
.login-form-container input[type="text"],
.login-form-container input[type="password"],
.login-form-container input[type="email"] {
  width: 100%;
  height: 56px;
  background: #f4f7ff;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 50px 0 18px;
  font-size: 1rem;
  color: #1a1a2e;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.login-form-container input[type="text"]::placeholder,
.login-form-container input[type="password"]::placeholder,
.login-form-container input[type="email"]::placeholder {
  color: #9ca3af;
}

.login-form-container input[type="text"]:focus,
.login-form-container input[type="password"]:focus,
.login-form-container input[type="email"]:focus {
  outline: none;
  border-color: #0066ff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* Password Toggle Icon Container */
.password-toggle-wrapper {
  position: relative;
}

.password-toggle-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: #6b7280;
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Forgot Password Link */
.forgot-password-link {
  display: block;
  text-align: right;
  margin-top: -10px;
}

.forgot-password-link a {
  font-size: 0.875rem;
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-password-link a:hover {
  color: #0066ff;
}

/* Submit Button */
.login-form-container input[type="submit"],
.login-form-container button[type="submit"],
.login-form-container .form-submit {
  width: 100%;
  height: 56px;
  background: #0066ff;
  color: #ffffff;
  border: none;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.login-form-container input[type="submit"]:hover,
.login-form-container button[type="submit"]:hover,
.login-form-container .form-submit:hover {
  background: #0052cc;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 102, 255, 0.35);
}

.login-form-container input[type="submit"]:active,
.login-form-container button[type="submit"]:active,
.login-form-container .form-submit:active {
  transform: translateY(0);
}

/* ==============================================
   SOCIAL LOGIN
   ============================================== */
.social-divider {
  display: flex;
  align-items: center;
  margin: 30px 0;
}

.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.social-divider span {
  padding: 0 20px;
  font-size: 0.875rem;
  color: #9ca3af;
  white-space: nowrap;
}

.social-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1a1a2e;
  transition: all 0.25s ease;
}

.social-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.social-icon {
  width: 20px;
  height: 20px;
}

/* ==============================================
   SIGNUP LINK
   ============================================== */
.signup-link {
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

.signup-link a {
  color: #0066ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.signup-link a:hover {
  color: #0052cc;
  text-decoration: underline;
}

/* ==============================================
   DRUPAL FORM OVERRIDES
   ============================================== */
/* Hide any Drupal generated cruft */
.login-form-container .description,
.login-form-container .form-item--error-message,
.login-form-container .password-suggestions {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 5px;
}

.login-form-container .form-item--error-message {
  color: #dc2626;
}


/* Hide any links Drupal adds (we handle them in template) */
.login-form-container .item-list,
.login-form-container ul {
  display: none;
}

/* ==============================================
   RTL SUPPORT (Hebrew)
   ============================================== */
[dir="rtl"] .login-page-body,
.login-page-body[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] .branding-content h1,
[dir="rtl"] .branding-content > p {
  text-align: right;
}

[dir="rtl"] .login-form-container input[type="text"],
[dir="rtl"] .login-form-container input[type="password"],
[dir="rtl"] .login-form-container input[type="email"] {
  padding: 0 18px 0 50px;
  text-align: right;
}

[dir="rtl"] .password-toggle-btn {
  right: auto;
  left: 15px;
}

[dir="rtl"] .forgot-password-link {
  text-align: left;
}

/* ==============================================
   RESPONSIVE DESIGN
   ============================================== */
@media (max-width: 900px) {
  .login-container {
    flex-direction: column;
    max-width: 500px;
    min-height: auto;
  }

  .login-branding-panel {
    padding: 40px 30px;
    min-height: 300px;
  }

  .branding-content h1 {
    font-size: 1.75rem;
    text-align: center;
  }

  .branding-content > p {
    text-align: center;
  }

  .branding-illustration img {
    max-height: 180px;
  }

  .login-form-panel {
    padding: 40px 30px;
  }
}

@media (max-width: 480px) {
  .login-page-wrapper {
    padding: 10px;
  }

  .login-container {
    border-radius: 16px;
  }

  .login-branding-panel {
    display: none; /* Hide on mobile for faster login */
  }

  .login-form-panel {
    padding: 30px 20px;
  }

  .form-wrapper {
    max-width: 100%;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .social-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .social-btn {
    width: 100%;
  }
}

/* ==============================================
   ANIMATIONS
   ============================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-wrapper {
  animation: fadeInUp 0.5s ease-out;
}

.branding-content {
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

/* Loading state for form submission */
.login-form-container.is-loading input[type="submit"] {
  pointer-events: none;
  opacity: 0.7;
}

.login-form-container.is-loading input[type="submit"]::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 10px;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Override existing forgot password link from Drupal */
.pass-link {
  display: block;
  text-align: right;
  margin-bottom: 10px;
  font-size: 0.875rem;
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 500;
}

.pass-link:hover {
  color: #0066ff;
}

/* ==============================================
   PASSWORD RESET PAGE ADDITIONS
   Add this to your login.css file
   ============================================== */

/* Password Reset Form Styling */
.password-reset-form .form-item {
  margin-bottom: 20px;
}

.password-reset-form label {
  display: block;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.password-reset-form input[type="text"],
.password-reset-form input[type="email"] {
  width: 100%;
  height: 56px;
  background: #f4f7ff;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 1rem;
  color: #1a1a2e;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.password-reset-form input[type="text"]:focus,
.password-reset-form input[type="email"]:focus {
  outline: none;
  border-color: #0066ff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

.password-reset-form input[type="submit"] {
  width: 100%;
  height: 56px;
  background: #0066ff;
  color: #ffffff;
  border: none;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.password-reset-form input[type="submit"]:hover {
  background: #0052cc;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* Hide description text if needed */
.password-reset-form .description {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 8px;
}

/* Try different method link styling */
.password-reset-form .try-different-method {
  display: block;
  text-align: center;
  margin-top: 15px;
  color: #6b7280;
  font-size: 0.9rem;
}

.password-reset-form .try-different-method a {
  color: #0066ff;
  text-decoration: underline;
}

/* Hide Drupal's default back-to links on password reset page */
.auth-user-form--footer, .form-header {
  display: none;
}

/* Remove padding from auth form elements */
.auth-user-form .auth-user-form--footer,
.auth-user-form > form {
  padding: 0 !important;
}

/* Hide the back-to links */
.auth-user-form--footer {
  display: none !important;
}

/* ==============================================
   REGISTRATION PAGE ADDITIONS
   Add this to your login.css file
   ============================================== */

/* Registration Form Styling */
.register-form .form-item {
  margin-bottom: 20px;
}

.register-form label {
  display: block;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"] {
  width: 100%;
  height: 56px;
  background: #f4f7ff;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 1rem;
  color: #1a1a2e;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.register-form input[type="text"]:focus,
.register-form input[type="email"]:focus,
.register-form input[type="password"]:focus {
  outline: none;
  border-color: #0066ff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* Submit button - Yellow/Gold style like reference */
.register-form input[type="submit"],
.register-form button[type="submit"] {
  width: 100%;
  height: 56px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1a1a2e;
  border: none;
  border-radius: 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.register-form input[type="submit"]:hover,
.register-form button[type="submit"]:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
}

/* Password strength indicator */
.register-form .password-strength {
  margin-top: 10px;
}

.register-form .password-strength__meter {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

.register-form .password-strength__indicator {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
}

.register-form .password-strength__title,
.register-form .password-strength__text {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 5px;
}

/* Password confirm */
.register-form .password-confirm {
  font-size: 0.8rem;
  margin-top: 5px;
}

.register-form .password-confirm.ok {
  color: #059669;
}

.register-form .password-confirm.error {
  color: #dc2626;
}

/* Description/help text */
.register-form .description {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 5px;
}

/* Error messages */
.register-form .form-item--error-message {
  color: #dc2626;
  font-size: 0.85rem;
  margin-top: 5px;
}

.register-form input.error {
  border-color: #dc2626;
  background: #fef2f2;
}

/* Hide unnecessary elements */
.register-form .auth-user-form--footer {
  display: none !important;
}

.register-form .auth-user-form > form {
  padding: 0 !important;
}

/* Hide the timezone and other non-essential fields */
.register-form .field--name-timezone,
.register-form .field--name-user-picture {
  display: none;
}

/* Confirmation checkbox styling */
.register-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  accent-color: #0066ff;
}

.register-form .form-type-checkbox label {
  display: inline;
  font-weight: 400;
}

/* Terms and conditions link */
.register-form .terms-link {
  color: #0066ff;
  text-decoration: underline;
}

/* RTL adjustments */
[dir="rtl"] .register-form input[type="checkbox"] {
  margin-right: 0;
  margin-left: 10px;
}