/* Login Modal Styles */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-modal--open {
  opacity: 1;
  visibility: visible;
}

.login-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(19, 52, 59, 0.85);
  backdrop-filter: blur(4px);
}

.login-modal__container {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 20px;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.login-modal--open .login-modal__container {
  transform: scale(1) translateY(0);
}

.login-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  z-index: 10;
}

.login-modal__close:hover {
  background: rgba(var(--color-brown-600-rgb), 0.1);
  color: var(--color-text);
}

.login-modal__close:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

.login-modal__content {
  padding: 40px;
}

.login-modal__header {
  text-align: center;
  margin-bottom: 32px;
}

.login-modal__title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.login-modal__subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Login Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  display: block;
}

.login-form__input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--font-family-base);
  color: var(--color-text);
  background: var(--color-background);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-form__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

.login-form__input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.login-form__password-wrapper {
  position: relative;
}

.login-form__toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.login-form__toggle-password:hover {
  color: var(--color-text);
}

.login-form__toggle-password:focus {
  outline: var(--focus-outline);
  outline-offset: 2px;
  border-radius: 4px;
}

.login-form__error {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.login-form__error--error {
  background: rgba(var(--color-error-rgb), var(--status-bg-opacity));
  border: 1px solid rgba(var(--color-error-rgb), var(--status-border-opacity));
  color: var(--color-error);
}

.login-form__error--success {
  background: rgba(var(--color-success-rgb), var(--status-bg-opacity));
  border: 1px solid rgba(var(--color-success-rgb), var(--status-border-opacity));
  color: var(--color-success);
}

.login-form__submit {
  width: 100%;
  margin-top: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-form__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-form__submit-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.login-modal__footer {
  margin-top: 24px;
  text-align: center;
}

.login-modal__help-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Header logout button */
.header__logout {
  margin-left: 8px;
}

/* Responsive */
@media (max-width: 640px) {
  .login-modal__container {
    margin: 10px;
    border-radius: 12px;
  }
  
  .login-modal__content {
    padding: 32px 24px;
  }
  
  .login-modal__title {
    font-size: 24px;
  }
  
  .header__actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .header__logout {
    margin-left: 0;
    width: 100%;
    margin-top: 4px;
  }
}

