/**
 * Login Page Frontend Styles
 * Split-Screen Modern Login Design
 *
 * @package Polanger_Dashboard_Tools_Pro
 * @since 4.3.0
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --pdt-login-primary: #8b5cf6;
  --pdt-login-primary-hover: #7c3aed;
  --pdt-login-secondary: #a78bfa;
  --pdt-login-bg: #ddd6fe;
  --pdt-login-card-bg: #ffffff;
  --pdt-login-text: #1e293b;
  --pdt-login-text-light: #ffffff;
  --pdt-login-text-muted: #64748b;
  --pdt-login-border: #e2e8f0;
  --pdt-login-input-bg: #ffffff;
  --pdt-login-input-focus: #8b5cf6;
  --pdt-login-error: #ef4444;
  --pdt-login-success: #10b981;
  --pdt-login-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --pdt-login-radius: 24px;
  --pdt-login-radius-sm: 30px;
}

/* ============================================
   Base - Split Screen Layout
   ============================================ */
body.login {
  background: var(--pdt-login-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  margin: 0;
}

body.login::before,
body.login::after {
  display: none;
}

/* ============================================
   Main Login Wrapper
   ============================================ */
#login {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  padding: 0;
  margin: 0;
}

.pdt-login-wrapper {
  display: flex;
  min-height: 550px;
  background: var(--pdt-login-card-bg);
  border-radius: var(--pdt-login-radius);
  box-shadow: var(--pdt-login-shadow);
  overflow: hidden;
}

/* ============================================
   Left Panel - Welcome Section
   ============================================ */
.pdt-login-left-panel {
  flex: 1;
  background: linear-gradient(135deg, var(--pdt-login-primary) 0%, var(--pdt-login-secondary) 100%);
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Decorative Elements */
.pdt-login-left-panel::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.pdt-login-left-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

/* Decorative shapes */
.pdt-login-decor {
  position: absolute;
  pointer-events: none;
}

.pdt-login-decor-1 {
  top: 30px;
  left: 40px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.pdt-login-decor-1::before,
.pdt-login-decor-1::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
}

.pdt-login-decor-1::before {
  width: 2px;
  height: 20px;
  left: 50%;
  top: -10px;
  transform: translateX(-50%);
}

.pdt-login-decor-1::after {
  width: 20px;
  height: 2px;
  top: 50%;
  left: -10px;
  transform: translateY(-50%);
}

.pdt-login-decor-2 {
  top: 60px;
  right: 80px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.pdt-login-decor-3 {
  top: 40px;
  right: 30px;
  display: grid;
  grid-template-columns: repeat(3, 8px);
  grid-template-rows: repeat(3, 8px);
  gap: 6px;
}

.pdt-login-decor-3 span {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
}

.pdt-login-decor-4 {
  bottom: 120px;
  left: 30px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

/* Wave decoration */
.pdt-login-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 150px;
  opacity: 0.15;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
}

/* Welcome Text */
.pdt-login-welcome {
  position: relative;
  z-index: 1;
}

/* Custom Logo */
.pdt-login-logo {
  display: block;
  margin-bottom: 24px;
}

.pdt-login-logo img {
  max-width: 180px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.pdt-login-logo:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

.pdt-login-welcome h2 {
  color: var(--pdt-login-text-light);
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.pdt-login-welcome p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  max-width: 320px;
}

/* ============================================
   Right Panel - Form Section
   ============================================ */
.pdt-login-right-panel {
  flex: 1;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Hide default logo */
#login h1 {
  display: none !important;
}

#login h1 a {
  display: block;
  width: 100%;
  height: 80px;
  margin: 0 auto 30px;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  text-indent: -9999px;
  outline: none;
  transition: transform 0.3s ease, filter 0.3s ease;
}

#login h1 a:hover {
  transform: scale(1.05);
}

#login h1 a:focus {
  box-shadow: none;
}

/* ============================================
   Login Form Card
   ============================================ */
.login form {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* Form Title */
.pdt-login-form-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--pdt-login-text);
  margin: 0 0 30px 0;
  text-align: center;
}

/* ============================================
   Form Labels
   ============================================ */
.login form .forgetmenot,
.login form label {
  color: var(--pdt-login-text);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

.login form label[for="user_login"]::before,
.login form label[for="user_pass"]::before {
  content: none;
}

/* ============================================
   Input Fields - Pill Style
   ============================================ */
.login form input[type="text"],
.login form input[type="password"],
.login form input[type="email"] {
  width: 100%;
  padding: 16px 24px 16px 50px;
  font-size: 12px;
  border: 1px solid var(--pdt-login-border);
  border-radius: 50px;
  background: var(--pdt-login-input-bg);
  color: var(--pdt-login-text);
  transition: all 0.3s ease;
  margin-top: 0;
  margin-bottom: 20px;
  box-shadow: none;
}

.login form input[type="text"]:focus,
.login form input[type="password"]:focus,
.login form input[type="email"]:focus {
  border-color: var(--pdt-login-input-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  outline: none;
}

.login form input[type="text"]::placeholder,
.login form input[type="password"]::placeholder,
.login form input[type="email"]::placeholder {
  color: var(--pdt-login-text-muted);
}

/* Input Icons via CSS - using input background */
#user_login {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='12' cy='7' r='4'%3E%3C/circle%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 18px center;
  background-size: 18px 18px;
}

#user_pass {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 18px center;
  background-size: 18px 18px;
}

#user_email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z'%3E%3C/path%3E%3Cpolyline points='22,6 12,13 2,6'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 18px center;
  background-size: 18px 18px;
}

/* Hide labels, use placeholders */
.login form label[for="user_login"],
.login form label[for="user_pass"] {
  position: absolute;
  left: -9999px;
}

/* ============================================
   Remember Me & Forgot Password Row
   ============================================ */
.login form .forgetmenot {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px !important;
}

.login form .forgetmenot label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  font-size: 13px;
  color: var(--pdt-login-text-muted);
  margin-left: 10px;
}

.login form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--pdt-login-border);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--pdt-login-primary);
  margin: 0;
}

.login form input[type="checkbox"]:checked {
  background: var(--pdt-login-primary);
  border-color: var(--pdt-login-primary);
}

/* ============================================
   Submit Button - Pill Style
   ============================================ */
.login form .submit {
  margin-top: 25px;
}

.login form p.submit {
  display: block;
}

.login form input[type="submit"],
.login form .button-primary {
  width: 100%;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--pdt-login-primary) 0%, var(--pdt-login-secondary) 100%);
  border: none;
  border-radius: 50px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
  text-shadow: none;
}

.login form input[type="submit"]:hover,
.login form .button-primary:hover {
  background: linear-gradient(135deg, var(--pdt-login-primary-hover) 0%, var(--pdt-login-primary) 100%);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.45);
  transform: translateY(-2px);
}

.login form input[type="submit"]:active,
.login form .button-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.login form input[type="submit"]:focus,
.login form .button-primary:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3), 0 8px 25px rgba(139, 92, 246, 0.35);
  outline: none;
}

/* ============================================
   Error & Success Messages
   ============================================ */
#login_error,
.login .message,
.login .success {
  border-radius: var(--pdt-login-radius-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#login_error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border-left: 4px solid var(--pdt-login-error);
}

#login_error a {
  color: #dc2626;
  font-weight: 600;
}

.login .message {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

.login .success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border-left: 4px solid var(--pdt-login-success);
}

/* ============================================
   Navigation Links - Inside Form
   ============================================ */
#nav,
#backtoblog {
  text-align: center;
  margin-top: 25px;
  padding: 0;
}

#nav a,
#backtoblog a {
  color: var(--pdt-login-text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s ease;
}

#nav a:hover,
#backtoblog a:hover {
  color: var(--pdt-login-primary);
}

#nav {
  background: transparent;
  border-radius: 0;
  padding: 0;
}

#nav a {
  margin: 0;
}

#nav a:first-child {
  color: var(--pdt-login-text);
}

/* Separator - Forgot password link */
.login #nav a:first-child::after {
  content: none;
}

.login #nav a:last-child {
  color: var(--pdt-login-primary);
  font-weight: 500;
}

/* New here? Create account text */
#backtoblog {
  margin-top: 30px;
}

#backtoblog a {
  color: var(--pdt-login-primary);
  font-weight: 500;
}

/* ============================================
   Privacy Policy Link
   ============================================ */
.login .privacy-policy-page-link {
  text-align: center;
  margin-top: 15px;
}

.login .privacy-policy-page-link a {
  color: var(--pdt-login-text-muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.login .privacy-policy-page-link a:hover {
  color: var(--pdt-login-primary);
}

/* ============================================
   Language Switcher - Bottom Right
   ============================================ */
.login .language-switcher {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  top: auto !important;
  left: auto !important;
  background: rgba(255, 255, 255, 0.17);
  border-radius: 5px;
  padding: 8px 12px 8px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login .language-switcher label {
  display: none;
}

.login .language-switcher select {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid var(--pdt-login-border);
  border-radius: 20px;
  background: #fff;
  color: var(--pdt-login-text);
  cursor: pointer;
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.login .language-switcher select:focus {
  border-color: var(--pdt-login-primary);
  outline: none;
}

.login .language-switcher input[type="submit"] {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  background: var(--pdt-login-primary);
  border: none;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login .language-switcher input[type="submit"]:hover {
  background: var(--pdt-login-primary-hover);
}

.login .language-switcher label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--pdt-login-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.login .language-switcher select {
  width: 100%;
  padding: 4px 5px;
  font-size: 12px;
  border: 2px solid var(--pdt-login-border);
  border-radius: var(--pdt-login-radius-sm);
  background: var(--pdt-login-input-bg);
  color: var(--pdt-login-text);
  cursor: pointer;
  margin-bottom: 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.login .language-switcher select:focus {
  border-color: var(--pdt-login-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login .language-switcher input[type="submit"] {
  width: 100%;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--pdt-login-primary) 0%, var(--pdt-login-secondary) 100%);
  border: none;
  border-radius: var(--pdt-login-radius-sm);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.login .language-switcher input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--pdt-login-primary-hover) 0%, var(--pdt-login-primary) 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* ============================================
   Password Strength Meter
   ============================================ */
.login #pass-strength-result {
  border-radius: var(--pdt-login-radius-sm);
  padding: 10px 15px;
  margin: 10px 0;
  font-weight: 600;
  text-align: center;
}

.login #pass-strength-result.short {
  background: #fecaca;
  color: #991b1b;
}

.login #pass-strength-result.bad {
  background: #fed7aa;
  color: #9a3412;
}

.login #pass-strength-result.good {
  background: #fef08a;
  color: #854d0e;
}

.login #pass-strength-result.strong {
  background: #bbf7d0;
  color: #166534;
}

/* ============================================
   Two Factor Authentication
   ============================================ */
.login .backup-methods-wrap {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--pdt-login-border);
}

/* ============================================
   reCAPTCHA Styling
   ============================================ */
.login .g-recaptcha {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  transform: scale(0.95);
  transform-origin: center;
}

.login .g-recaptcha > div {
  border-radius: var(--pdt-login-radius-sm);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Loading State
   ============================================ */
.login form.loading {
  pointer-events: none;
  opacity: 0.7;
}

.login form.loading input[type="submit"] {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
  cursor: wait;
}

/* ============================================
   Shake Animation for Errors
   ============================================ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login form.shake {
  animation: shake 0.5s ease-in-out;
}

/* ============================================
   Responsive Design - Split Screen
   ============================================ */
@media (max-width: 900px) {
  #login {
    max-width: 500px;
  }
  
  .pdt-login-wrapper {
    flex-direction: column;
    min-height: auto;
  }
  
  .pdt-login-left-panel {
    padding: 40px 30px;
    min-height: 180px;
  }
  
  .pdt-login-welcome h2 {
    font-size: 32px;
  }
  
  .pdt-login-right-panel {
    padding: 40px 30px;
  }
  
  /* Language switcher tablet - move to bottom right, smaller */
  .login .language-switcher {
    position: fixed !important;
    bottom: 15px !important;
    right: 15px !important;
    left: auto !important;
    top: auto !important;
    padding: 10px 15px !important;
    z-index: 9999 !important;
  }
}

@media (max-width: 520px) {
  body.login {
    padding: 15px;
    padding-bottom: 100px;
  }
  
  .pdt-login-wrapper {
    border-radius: 16px;
  }
  
  .pdt-login-left-panel {
    padding: 30px 25px;
    min-height: 150px;
  }
  
  .pdt-login-welcome h2 {
    font-size: 26px;
  }
  
  .pdt-login-welcome p {
    font-size: 14px;
  }
  
  .pdt-login-right-panel {
    padding: 30px 25px;
  }
  
  .pdt-login-form-title {
    font-size: 24px;
  }
  
  .login form input[type="text"],
  .login form input[type="password"],
  .login form input[type="email"] {
    padding: 14px 20px 14px 45px;
    font-size: 16px;
  }
  
  .login form p:has(input[type="text"])::before,
  .login form p:has(input[type="password"])::before {
    left: 16px;
  }
  
  /* Language switcher mobile - fixed to bottom */
  .login .language-switcher {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 20px !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    z-index: 9999 !important;
  }
  
  .login .language-switcher label {
    display: none !important;
  }
  
  .login .language-switcher select {
    flex: 1;
    max-width: 200px;
    margin-bottom: 0 !important;
  }
  
  .login .language-switcher input[type="submit"] {
    width: auto !important;
    padding: 8px 20px !important;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  body.login {
    background: #fff !important;
  }
  
  body.login::before,
  body.login::after {
    display: none;
  }
  
  .login form {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   Accessibility Improvements
   ============================================ */
.login form input:focus-visible,
.login form button:focus-visible,
.login a:focus-visible {
  outline: 3px solid var(--pdt-login-primary);
  outline-offset: 2px;
}

/* Screen Reader Only */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Custom Scrollbar
   ============================================ */
body.login::-webkit-scrollbar {
  width: 8px;
}

body.login::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

body.login::-webkit-scrollbar-thumb {
  background: var(--pdt-login-primary);
  border-radius: 4px;
}

body.login::-webkit-scrollbar-thumb:hover {
  background: var(--pdt-login-primary-hover);
}
