:root {
  --primary-color: #4caf50;
  --primary-hover: #388e3c;
  --primary-light: #e8f5e8;
  --secondary-color: #66bb6a;
  --danger-color: #f44336;
  --warning-color: #ff9800;
  --success-color: #4caf50;
  --dark-text: #333;
  --medium-text: #666;
  --light-text: #888;
  --border-light: #e0e0e0;
  --background-light: #f8f9fa;
  --gradient-start: #618668;
  --gradient-end: #a2e0d8;
  --transition: all 0.3s ease;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark-text);
  background: linear-gradient(135deg, #2d8659 0%, #4caf50 50%, #66bb6a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

/* Main Container - Flexible Layout */
.main-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.main-container::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

/* Login Wrapper - Optimized */
.login-wrapper {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 1100px;
  height: auto;
  max-height: 90vh;
  display: flex;
  animation: slideInUp 0.6s ease;
  position: relative;
  z-index: 1;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Left Section */
.left-section {
  background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
  width: 42%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 50px 40px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 550px;
}

.left-section::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.left-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 28px;
  font-weight: bold;
}

.brand-logo i {
  font-size: 32px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.signup-text {
  text-align: center;
}

.signup-text h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.signup-text p {
  font-size: 15px;
  opacity: 0.9;
  line-height: 1.5;
}

.signup-btn {
  background: white;
  color: var(--primary-color);
  border: none;
  border-radius: 25px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.signup-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  background: #f0f0f0;
}

.signup-btn:active {
  transform: translateY(-1px);
}

/* Right Section - No Scrollbars */
.right-section {
  width: 58%;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 50px 50px;
  position: relative;
  min-height: 550px;
}

.login-header {
  margin-bottom: 30px;
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--dark-text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 15px;
  color: var(--medium-text);
  margin: 0;
}

/* Alert Boxes */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  animation: slideIn 0.4s ease;
  border: 2px solid;
  font-size: 13px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.error-alert {
  background: #fff5f5;
  border-color: #f44336;
  color: #c62828;
}

.error-alert .alert-icon {
  color: #f44336;
}

.success-alert {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

.success-alert .alert-icon {
  color: #4caf50;
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
}

.alert-message {
  font-size: 12px;
  line-height: 1.4;
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  opacity: 0.7;
  transition: var(--transition);
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--dark-text);
  font-size: 14px;
}

.password-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-link-inline {
  font-size: 13px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.forgot-link-inline:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Input Wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input,
.modal-input {
  width: 100%;
  padding: 12px 45px 12px 45px;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  font-size: 14px;
  color: var(--dark-text);
  background: var(--background-light);
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus,
.modal-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.form-input.error,
.modal-input.error {
  border-color: var(--danger-color);
  background: #fff5f5;
}

.form-input.success {
  border-color: var(--success-color);
  background: #e8f5e9;
}

.input-icon {
  position: absolute;
  left: 15px;
  color: var(--light-text);
  font-size: 16px;
  pointer-events: none;
}

.input-indicator {
  position: absolute;
  right: 15px;
  color: var(--light-text);
  font-size: 16px;
  transition: var(--transition);
  opacity: 0;
}

.form-input:focus ~ .input-indicator {
  opacity: 1;
}

.input-indicator.success {
  color: var(--success-color);
  opacity: 1;
}

.input-indicator.error {
  color: var(--danger-color);
  opacity: 1;
}

.input-helper {
  font-size: 12px;
  color: var(--light-text);
  display: block;
}

.input-helper.error {
  color: var(--danger-color);
}

.input-helper.success {
  color: var(--success-color);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: var(--light-text);
  cursor: pointer;
  font-size: 16px;
  padding: 5px 8px;
  transition: var(--transition);
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--primary-color);
  background: rgba(76, 175, 80, 0.1);
}

/* Form Footer */
.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 5px 0 10px 0;
}

.remember-me-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--medium-text);
  user-select: none;
}

.remember-me-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* Login Button */
.login-btn {
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
  margin: 10px 0;
}

.login-btn:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--primary-hover),
    var(--primary-color)
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(76, 175, 80, 0.4);
}

.login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-icon {
  font-size: 16px;
  transition: var(--transition);
}

.login-btn:hover:not(:disabled) .btn-icon {
  transform: translateX(4px);
}

.btn-loader {
  display: none;
  font-size: 16px;
  position: absolute;
}

.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Sign Up Link */
.signup-link {
  text-align: center;
  font-size: 13px;
  color: var(--medium-text);
  margin: 5px 0;
}

.signup-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.signup-link a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1051;
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  animation: slideInModal 0.3s ease;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

@keyframes slideInModal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-shrink: 0;
}

.modal-header-content {
  flex: 1;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
  line-height: 1.4;
}

.close-modal {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: var(--transition);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.close-modal:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.modal-body {
  padding: 25px 30px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-alert {
  margin-top: 10px;
  margin-bottom: 0;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  padding: 20px 30px;
  background: var(--primary-light);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.modal-btn {
  padding: 11px 22px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 90px;
}

.modal-btn-cancel {
  background: white;
  color: var(--medium-text);
  border: 2px solid var(--border-light);
}

.modal-btn-cancel:hover {
  background: var(--background-light);
  border-color: var(--medium-text);
  transform: translateY(-2px);
}

.modal-btn-send {
  background: var(--primary-color);
  color: white;
}

.modal-btn-send:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.modal-btn-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
  .login-wrapper {
    flex-direction: column;
    max-height: none;
    height: auto;
  }

  .left-section,
  .right-section {
    width: 100%;
    min-height: auto;
    padding: 40px 30px;
  }

  .left-section {
    min-height: 280px;
  }

  .login-title {
    font-size: 28px;
  }

  .signup-text h2 {
    font-size: 22px;
  }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .main-container {
    padding: 15px;
  }

  .login-wrapper {
    border-radius: 16px;
  }

  .left-section,
  .right-section {
    padding: 30px 20px;
  }

  .login-title {
    font-size: 24px;
  }

  .signup-text h2 {
    font-size: 20px;
  }

  .form-input,
  .modal-input {
    padding: 11px 40px 11px 40px;
    font-size: 16px;
  }

  .brand-logo {
    font-size: 22px;
  }

  .brand-logo i {
    font-size: 28px;
  }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
  .main-container {
    padding: 12px;
  }

  .login-wrapper {
    border-radius: 12px;
  }

  .left-section,
  .right-section {
    padding: 25px 15px;
  }

  .left-content {
    gap: 20px;
  }

  .brand-logo {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .brand-logo i {
    font-size: 24px;
  }

  .signup-text h2 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .signup-text p {
    font-size: 13px;
  }

  .login-header {
    margin-bottom: 20px;
  }

  .login-title {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .login-subtitle {
    font-size: 13px;
  }

  .alert-box {
    padding: 12px 14px;
    gap: 10px;
    margin-bottom: 15px;
  }

  .alert-icon {
    font-size: 16px;
  }

  .alert-title {
    font-size: 12px;
  }

  .alert-message {
    font-size: 11px;
  }

  .form-group {
    gap: 4px;
  }

  .form-label {
    font-size: 13px;
  }

  .form-input,
  .modal-input {
    padding: 10px 35px 10px 35px;
    font-size: 16px;
  }

  .input-icon {
    left: 12px;
    font-size: 14px;
  }

  .password-toggle {
    right: 12px;
    font-size: 14px;
  }

  .input-helper {
    font-size: 11px;
  }

  .login-btn {
    padding: 11px;
    font-size: 14px;
    margin: 8px 0;
  }

  .signup-link {
    font-size: 12px;
    margin: 4px 0;
  }

  .modal-header {
    padding: 20px;
    gap: 15px;
  }

  .modal-title {
    font-size: 18px;
  }

  .modal-subtitle {
    font-size: 13px;
  }

  .close-modal {
    width: 32px;
    height: 32px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-actions {
    padding: 15px;
    gap: 10px;
  }

  .modal-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    min-width: 70px;
  }
}

/* Hide browser password reveal button */
input::-ms-reveal,
input::-ms-clear {
  display: none;
}

::-ms-reveal {
  display: none;
}

::-webkit-textfield-decoration-container {
  visibility: hidden;
}
