/**
 * Custom Login Frontend Styles
 * 
 * @package Flykod_Custom_Login
 * @version 1.0.0
 */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.flykod-custom-login-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Main Container */
.flykod-custom-login-container {
  width: 100vw;
  height: 100vh;
  max-width: none;
  min-height: 100vh;
  display: flex;
  background: var(--form-bg-color, #ffffff);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
}

/* Form Section */
.login-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 5rem;
  min-height: 100vh;
  width: 100%;
  max-width: 500px;
}

.form-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* Client Logo */
.client-logo {
  margin-bottom: 40px;
}

.logo-img {
  width: 100%;
  display: block;
  margin: 0 auto;
  height: auto;
  margin-bottom: 6rem;
}

/* Page Title */
.login-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 4rem;
  line-height: 1.2;
}

/* Form Groups */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}

.form-group label {
  display: flex;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 2px;
}

.form-group .input {
  width: 100%;
  padding: 6px 16px;
  border: 1px solid #ababab;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fff;
}

.form-group .input:focus {
  outline: none;
  border-color: var(--accent-color, #03799b);
  box-shadow: 0 0 0 3px rgba(3, 121, 155, 0.1);
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: block;
}

.password-input-wrapper .input {
  padding-right: 50px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #666;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}

.password-toggle:hover {
  color: var(--accent-color, #292929);
}

.password-toggle:focus {
  outline: 2px solid var(--accent-color, #292929);
  outline-offset: 2px;
}

.eye-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eye-icon.eye-closed {
  display: none;
}

.password-toggle.showing .eye-icon.eye-open {
  display: none;
}

.password-toggle.showing .eye-icon.eye-closed {
  display: block;
}

/* Checkbox Styling */
.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: #555;
  margin: 0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #e1e5e9;
  border-radius: 4px;
  margin-right: 12px;
  position: relative;
  transition: all 0.3s ease;
  background: #fff;
  display: block;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--accent-color, #03799b);
  border-color: var(--accent-color, #03799b);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Login Button */
.login-button {
  width: 100%;
  padding: 10px 24px;
  background: var(--accent-color, #03799b);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.login-button:hover {
  background: var(--accent-color-hover, #025a73);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(3, 121, 155, 0.3);
}

.login-button:active {
  transform: translateY(0);
}

/* Form Links */
.form-links {
  text-align: center;
}

.form-links a {
  color: var(--accent-color, #03799b);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.form-links a:hover {
  color: var(--accent-color-hover, #025a73);
  text-decoration: underline;
}

/* Description Text */
.description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 24px;
  text-align: left;
}

/* Messages */
.login-error,
.login-success {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.login-error {
  background: #fee;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.login-error p {
  margin-bottom: 0;
}

.login-success {
  background: #f0fff4;
  color: #2f855a;
  border: 1px solid #9ae6b4;
}

.login-success p {
  margin-bottom: 0;
}

/* Lateral Image Section */
.side-image-section {
  flex: 2;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  min-height: 100vh;
}

.side-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Form Position Variations */
.flykod-custom-login-container.left-form {
  flex-direction: row;
}

.flykod-custom-login-container.right-form {
  flex-direction: row-reverse;
}

/* Responsive Design */
@media (max-width: 768px) {
  .flykod-custom-login-container {
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
  }

  .flykod-custom-login-container.left-form,
  .flykod-custom-login-container.right-form {
    display: flex;
    flex-direction: column;
  }

  .login-form-section {
    padding: 40px 20px;
    min-height: auto;
    order: 2;
    max-width: 100%;
  }

  .side-image-section {
    min-height: unset;
    max-height: 20vh;
    order: 1;
  }

  .form-content {
    max-width: 100%;
  }

  .login-title {
    font-size: 1.75rem;
    margin-bottom: 24px;
  }

  .client-logo {
    margin-bottom: 30px;
  }

  .logo-img {
    margin-bottom: 3rem;
  }
}

@media (max-width: 480px) {
  .flykod-custom-login-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    width: 100vw;
    height: 100vh;
  }

  .login-form-section {
    padding: 30px 20px;
  }

  .side-image-section {
    height: 180px;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .form-group .input {
    padding: 10px 14px;
  }

  .login-button {
    padding: 12px 20px;
  }
}

/* Mobile Preview Mode - usado no admin para preview */
.flykod-custom-login-container.mobile-preview {
  display: flex;
  flex-direction: column !important;
  height: 100vh;
  overflow: hidden;
}

.flykod-custom-login-container.mobile-preview.left-form,
.flykod-custom-login-container.mobile-preview.right-form {
  display: flex;
  flex-direction: column !important;
}

.flykod-custom-login-container.mobile-preview .side-image-section {
  min-height: unset;
  max-height: 200px;
  height: 200px;
  order: 1;
  flex-shrink: 0;
}

.flykod-custom-login-container.mobile-preview .login-form-section {
  padding: 30px 3rem;
  min-height: unset;
  order: 2;
  flex: 1;
  overflow-y: auto;
  max-width: 100%;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .flykod-custom-login-container {
    border: 2px solid #000;
  }

  .form-group .input {
    border-width: 2px;
  }

  .login-button {
    border: 2px solid #000;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .form-group .input,
  .login-button,
  .checkbox-label,
  .checkmark {
    transition: none;
  }

  .login-button:hover {
    transform: none;
  }
}

/* Focus Styles for Accessibility */
.form-group .input:focus,
.login-button:focus,
.checkbox-label:focus-within .checkmark {
  outline: 2px solid var(--accent-color, #03799b);
  outline-offset: 2px;
}

/* Loading State */
.login-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 8px;
  font-size: 0.8rem;
  color: #666;
}

.password-strength.weak {
  color: #c53030;
}

.password-strength.medium {
  color: #d69e2e;
}

.password-strength.strong {
  color: #2f855a;
}

